imate
C++/CUDA Reference
py_c_trace_estimator.cpp
Go to the documentation of this file.
1 /* Generated by Cython 0.29.36 */
2 
3 /* BEGIN: Cython Metadata
4 {
5  "distutils": {
6  "define_macros": [
7  [
8  "CYTHON_EXTERN_C",
9  "extern \"C\""
10  ],
11  [
12  "CYTHON_EXTERN_C",
13  "extern \"C\""
14  ],
15  [
16  "CYTHON_EXTERN_C",
17  "extern \"C\""
18  ],
19  [
20  "CYTHON_EXTERN_C",
21  "extern \"C\""
22  ],
23  [
24  "CYTHON_EXTERN_C",
25  "extern \"C\""
26  ],
27  [
28  "CYTHON_EXTERN_C",
29  "extern \"C\""
30  ],
31  [
32  "CYTHON_EXTERN_C",
33  "extern \"C\""
34  ],
35  [
36  "CYTHON_EXTERN_C",
37  "extern \"C\""
38  ],
39  [
40  "CYTHON_EXTERN_C",
41  "extern \"C\""
42  ],
43  [
44  "CYTHON_EXTERN_C",
45  "extern \"C\""
46  ],
47  [
48  "CYTHON_EXTERN_C",
49  "extern \"C\""
50  ],
51  [
52  "CYTHON_EXTERN_C",
53  "extern \"C\""
54  ],
55  [
56  "CYTHON_EXTERN_C",
57  "extern \"C\""
58  ],
59  [
60  "CYTHON_EXTERN_C",
61  "extern \"C\""
62  ],
63  [
64  "CYTHON_EXTERN_C",
65  "extern \"C\""
66  ]
67  ],
68  "depends": [
69  "imate/_c_linear_operator/c_linear_operator.h",
70  "imate/_c_trace_estimator/c_trace_estimator.h",
71  "imate/_definitions/definitions.h",
72  "imate/functions/exponential.h",
73  "imate/functions/functions.h",
74  "imate/functions/gaussian.h",
75  "imate/functions/homographic.h",
76  "imate/functions/identity.h",
77  "imate/functions/indicator.h",
78  "imate/functions/inverse.h",
79  "imate/functions/logarithm.h",
80  "imate/functions/smoothstep.h"
81  ],
82  "include_dirs": [
83  "./imate/functions",
84  "./imate/_c_linear_operator",
85  "./imate/_definitions",
86  "./imate/_c_trace_estimator",
87  "i",
88  "m",
89  "a",
90  "t",
91  "e",
92  "/",
93  "_",
94  "c",
95  "l",
96  "n",
97  "r",
98  "o",
99  "p",
100  "b",
101  "s",
102  "g",
103  "d",
104  "u"
105  ],
106  "language": "c++",
107  "name": "imate._c_trace_estimator.py_c_trace_estimator",
108  "sources": [
109  "./imate/_c_trace_estimator/py_c_trace_estimator.pyx",
110  "./imate/_c_trace_estimator/c_orthogonalization.cpp",
111  "./imate/_c_trace_estimator/c_lanczos_tridiagonalization.cpp",
112  "./imate/_c_trace_estimator/lapack_api.cpp",
113  "./imate/_c_trace_estimator/c_golub_kahn_bidiagonalization.cpp",
114  "./imate/_c_trace_estimator/diagonalization.cpp",
115  "./imate/_c_trace_estimator/c_trace_estimator.cpp",
116  "./imate/_c_trace_estimator/special_functions.cpp",
117  "./imate/_c_trace_estimator/convergence_tools.cpp",
118  "imate/_c_linear_operator/c_csc_matrix.cpp",
119  "imate/_c_linear_operator/c_linear_operator.cpp",
120  "imate/_c_linear_operator/c_matrix.cpp",
121  "imate/_c_linear_operator/c_affine_matrix_function.cpp",
122  "imate/_c_linear_operator/c_dense_affine_matrix_function.cpp",
123  "imate/_c_linear_operator/c_csr_matrix.cpp",
124  "imate/_c_linear_operator/c_csr_affine_matrix_function.cpp",
125  "imate/_c_linear_operator/c_csc_affine_matrix_function.cpp",
126  "imate/_c_linear_operator/c_dense_matrix.cpp",
127  "imate/_c_basic_algebra/c_vector_operations.cpp",
128  "imate/_c_basic_algebra/c_matrix_operations.cpp",
129  "imate/_c_basic_algebra/cblas_interface.cpp",
130  "imate/_random_generator/random_array_generator.cpp",
131  "imate/_random_generator/random_number_generator.cpp",
132  "imate/_random_generator/highres_time_stamp.cpp",
133  "imate/_random_generator/xoshiro_256_star_star.cpp",
134  "imate/_random_generator/split_mix_64.cpp",
135  "imate/_utilities/timer.cpp"
136  ]
137  },
138  "module_name": "imate._c_trace_estimator.py_c_trace_estimator"
139 }
140 END: Cython Metadata */
141 
142 #ifndef PY_SSIZE_T_CLEAN
143 #define PY_SSIZE_T_CLEAN
144 #endif /* PY_SSIZE_T_CLEAN */
145 #include "Python.h"
146 #ifndef Py_PYTHON_H
147  #error Python headers needed to compile C extensions, please install development version of Python.
148 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
149  #error Cython requires Python 2.6+ or Python 3.3+.
150 #else
151 #define CYTHON_ABI "0_29_36"
152 #define CYTHON_HEX_VERSION 0x001D24F0
153 #define CYTHON_FUTURE_DIVISION 1
154 #include <stddef.h>
155 #ifndef offsetof
156  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
157 #endif
158 #if !defined(WIN32) && !defined(MS_WINDOWS)
159  #ifndef __stdcall
160  #define __stdcall
161  #endif
162  #ifndef __cdecl
163  #define __cdecl
164  #endif
165  #ifndef __fastcall
166  #define __fastcall
167  #endif
168 #endif
169 #ifndef DL_IMPORT
170  #define DL_IMPORT(t) t
171 #endif
172 #ifndef DL_EXPORT
173  #define DL_EXPORT(t) t
174 #endif
175 #define __PYX_COMMA ,
176 #ifndef HAVE_LONG_LONG
177  #if PY_VERSION_HEX >= 0x02070000
178  #define HAVE_LONG_LONG
179  #endif
180 #endif
181 #ifndef PY_LONG_LONG
182  #define PY_LONG_LONG LONG_LONG
183 #endif
184 #ifndef Py_HUGE_VAL
185  #define Py_HUGE_VAL HUGE_VAL
186 #endif
187 #ifdef PYPY_VERSION
188  #define CYTHON_COMPILING_IN_PYPY 1
189  #define CYTHON_COMPILING_IN_PYSTON 0
190  #define CYTHON_COMPILING_IN_CPYTHON 0
191  #define CYTHON_COMPILING_IN_NOGIL 0
192  #undef CYTHON_USE_TYPE_SLOTS
193  #define CYTHON_USE_TYPE_SLOTS 0
194  #undef CYTHON_USE_PYTYPE_LOOKUP
195  #define CYTHON_USE_PYTYPE_LOOKUP 0
196  #if PY_VERSION_HEX < 0x03050000
197  #undef CYTHON_USE_ASYNC_SLOTS
198  #define CYTHON_USE_ASYNC_SLOTS 0
199  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
200  #define CYTHON_USE_ASYNC_SLOTS 1
201  #endif
202  #undef CYTHON_USE_PYLIST_INTERNALS
203  #define CYTHON_USE_PYLIST_INTERNALS 0
204  #undef CYTHON_USE_UNICODE_INTERNALS
205  #define CYTHON_USE_UNICODE_INTERNALS 0
206  #undef CYTHON_USE_UNICODE_WRITER
207  #define CYTHON_USE_UNICODE_WRITER 0
208  #undef CYTHON_USE_PYLONG_INTERNALS
209  #define CYTHON_USE_PYLONG_INTERNALS 0
210  #undef CYTHON_AVOID_BORROWED_REFS
211  #define CYTHON_AVOID_BORROWED_REFS 1
212  #undef CYTHON_ASSUME_SAFE_MACROS
213  #define CYTHON_ASSUME_SAFE_MACROS 0
214  #undef CYTHON_UNPACK_METHODS
215  #define CYTHON_UNPACK_METHODS 0
216  #undef CYTHON_FAST_THREAD_STATE
217  #define CYTHON_FAST_THREAD_STATE 0
218  #undef CYTHON_FAST_PYCALL
219  #define CYTHON_FAST_PYCALL 0
220  #if PY_VERSION_HEX < 0x03090000
221  #undef CYTHON_PEP489_MULTI_PHASE_INIT
222  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
223  #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT)
224  #define CYTHON_PEP489_MULTI_PHASE_INIT 1
225  #endif
226  #undef CYTHON_USE_TP_FINALIZE
227  #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00)
228  #undef CYTHON_USE_DICT_VERSIONS
229  #define CYTHON_USE_DICT_VERSIONS 0
230  #undef CYTHON_USE_EXC_INFO_STACK
231  #define CYTHON_USE_EXC_INFO_STACK 0
232  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
233  #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
234  #endif
235 #elif defined(PYSTON_VERSION)
236  #define CYTHON_COMPILING_IN_PYPY 0
237  #define CYTHON_COMPILING_IN_PYSTON 1
238  #define CYTHON_COMPILING_IN_CPYTHON 0
239  #define CYTHON_COMPILING_IN_NOGIL 0
240  #ifndef CYTHON_USE_TYPE_SLOTS
241  #define CYTHON_USE_TYPE_SLOTS 1
242  #endif
243  #undef CYTHON_USE_PYTYPE_LOOKUP
244  #define CYTHON_USE_PYTYPE_LOOKUP 0
245  #undef CYTHON_USE_ASYNC_SLOTS
246  #define CYTHON_USE_ASYNC_SLOTS 0
247  #undef CYTHON_USE_PYLIST_INTERNALS
248  #define CYTHON_USE_PYLIST_INTERNALS 0
249  #ifndef CYTHON_USE_UNICODE_INTERNALS
250  #define CYTHON_USE_UNICODE_INTERNALS 1
251  #endif
252  #undef CYTHON_USE_UNICODE_WRITER
253  #define CYTHON_USE_UNICODE_WRITER 0
254  #undef CYTHON_USE_PYLONG_INTERNALS
255  #define CYTHON_USE_PYLONG_INTERNALS 0
256  #ifndef CYTHON_AVOID_BORROWED_REFS
257  #define CYTHON_AVOID_BORROWED_REFS 0
258  #endif
259  #ifndef CYTHON_ASSUME_SAFE_MACROS
260  #define CYTHON_ASSUME_SAFE_MACROS 1
261  #endif
262  #ifndef CYTHON_UNPACK_METHODS
263  #define CYTHON_UNPACK_METHODS 1
264  #endif
265  #undef CYTHON_FAST_THREAD_STATE
266  #define CYTHON_FAST_THREAD_STATE 0
267  #undef CYTHON_FAST_PYCALL
268  #define CYTHON_FAST_PYCALL 0
269  #undef CYTHON_PEP489_MULTI_PHASE_INIT
270  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
271  #undef CYTHON_USE_TP_FINALIZE
272  #define CYTHON_USE_TP_FINALIZE 0
273  #undef CYTHON_USE_DICT_VERSIONS
274  #define CYTHON_USE_DICT_VERSIONS 0
275  #undef CYTHON_USE_EXC_INFO_STACK
276  #define CYTHON_USE_EXC_INFO_STACK 0
277  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
278  #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
279  #endif
280 #elif defined(PY_NOGIL)
281  #define CYTHON_COMPILING_IN_PYPY 0
282  #define CYTHON_COMPILING_IN_PYSTON 0
283  #define CYTHON_COMPILING_IN_CPYTHON 0
284  #define CYTHON_COMPILING_IN_NOGIL 1
285  #ifndef CYTHON_USE_TYPE_SLOTS
286  #define CYTHON_USE_TYPE_SLOTS 1
287  #endif
288  #undef CYTHON_USE_PYTYPE_LOOKUP
289  #define CYTHON_USE_PYTYPE_LOOKUP 0
290  #ifndef CYTHON_USE_ASYNC_SLOTS
291  #define CYTHON_USE_ASYNC_SLOTS 1
292  #endif
293  #undef CYTHON_USE_PYLIST_INTERNALS
294  #define CYTHON_USE_PYLIST_INTERNALS 0
295  #ifndef CYTHON_USE_UNICODE_INTERNALS
296  #define CYTHON_USE_UNICODE_INTERNALS 1
297  #endif
298  #undef CYTHON_USE_UNICODE_WRITER
299  #define CYTHON_USE_UNICODE_WRITER 0
300  #undef CYTHON_USE_PYLONG_INTERNALS
301  #define CYTHON_USE_PYLONG_INTERNALS 0
302  #ifndef CYTHON_AVOID_BORROWED_REFS
303  #define CYTHON_AVOID_BORROWED_REFS 0
304  #endif
305  #ifndef CYTHON_ASSUME_SAFE_MACROS
306  #define CYTHON_ASSUME_SAFE_MACROS 1
307  #endif
308  #ifndef CYTHON_UNPACK_METHODS
309  #define CYTHON_UNPACK_METHODS 1
310  #endif
311  #undef CYTHON_FAST_THREAD_STATE
312  #define CYTHON_FAST_THREAD_STATE 0
313  #undef CYTHON_FAST_PYCALL
314  #define CYTHON_FAST_PYCALL 0
315  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
316  #define CYTHON_PEP489_MULTI_PHASE_INIT 1
317  #endif
318  #ifndef CYTHON_USE_TP_FINALIZE
319  #define CYTHON_USE_TP_FINALIZE 1
320  #endif
321  #undef CYTHON_USE_DICT_VERSIONS
322  #define CYTHON_USE_DICT_VERSIONS 0
323  #undef CYTHON_USE_EXC_INFO_STACK
324  #define CYTHON_USE_EXC_INFO_STACK 0
325 #else
326  #define CYTHON_COMPILING_IN_PYPY 0
327  #define CYTHON_COMPILING_IN_PYSTON 0
328  #define CYTHON_COMPILING_IN_CPYTHON 1
329  #define CYTHON_COMPILING_IN_NOGIL 0
330  #ifndef CYTHON_USE_TYPE_SLOTS
331  #define CYTHON_USE_TYPE_SLOTS 1
332  #endif
333  #if PY_VERSION_HEX < 0x02070000
334  #undef CYTHON_USE_PYTYPE_LOOKUP
335  #define CYTHON_USE_PYTYPE_LOOKUP 0
336  #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
337  #define CYTHON_USE_PYTYPE_LOOKUP 1
338  #endif
339  #if PY_MAJOR_VERSION < 3
340  #undef CYTHON_USE_ASYNC_SLOTS
341  #define CYTHON_USE_ASYNC_SLOTS 0
342  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
343  #define CYTHON_USE_ASYNC_SLOTS 1
344  #endif
345  #if PY_VERSION_HEX < 0x02070000
346  #undef CYTHON_USE_PYLONG_INTERNALS
347  #define CYTHON_USE_PYLONG_INTERNALS 0
348  #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
349  #define CYTHON_USE_PYLONG_INTERNALS (PY_VERSION_HEX < 0x030C00A5)
350  #endif
351  #ifndef CYTHON_USE_PYLIST_INTERNALS
352  #define CYTHON_USE_PYLIST_INTERNALS 1
353  #endif
354  #ifndef CYTHON_USE_UNICODE_INTERNALS
355  #define CYTHON_USE_UNICODE_INTERNALS 1
356  #endif
357  #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2
358  #undef CYTHON_USE_UNICODE_WRITER
359  #define CYTHON_USE_UNICODE_WRITER 0
360  #elif !defined(CYTHON_USE_UNICODE_WRITER)
361  #define CYTHON_USE_UNICODE_WRITER 1
362  #endif
363  #ifndef CYTHON_AVOID_BORROWED_REFS
364  #define CYTHON_AVOID_BORROWED_REFS 0
365  #endif
366  #ifndef CYTHON_ASSUME_SAFE_MACROS
367  #define CYTHON_ASSUME_SAFE_MACROS 1
368  #endif
369  #ifndef CYTHON_UNPACK_METHODS
370  #define CYTHON_UNPACK_METHODS 1
371  #endif
372  #if PY_VERSION_HEX >= 0x030B00A4
373  #undef CYTHON_FAST_THREAD_STATE
374  #define CYTHON_FAST_THREAD_STATE 0
375  #elif !defined(CYTHON_FAST_THREAD_STATE)
376  #define CYTHON_FAST_THREAD_STATE 1
377  #endif
378  #ifndef CYTHON_FAST_PYCALL
379  #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030A0000)
380  #endif
381  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
382  #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
383  #endif
384  #ifndef CYTHON_USE_TP_FINALIZE
385  #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
386  #endif
387  #ifndef CYTHON_USE_DICT_VERSIONS
388  #define CYTHON_USE_DICT_VERSIONS ((PY_VERSION_HEX >= 0x030600B1) && (PY_VERSION_HEX < 0x030C00A5))
389  #endif
390  #if PY_VERSION_HEX >= 0x030B00A4
391  #undef CYTHON_USE_EXC_INFO_STACK
392  #define CYTHON_USE_EXC_INFO_STACK 0
393  #elif !defined(CYTHON_USE_EXC_INFO_STACK)
394  #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
395  #endif
396  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
397  #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
398  #endif
399 #endif
400 #if !defined(CYTHON_FAST_PYCCALL)
401 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
402 #endif
403 #if CYTHON_USE_PYLONG_INTERNALS
404  #if PY_MAJOR_VERSION < 3
405  #include "longintrepr.h"
406  #endif
407  #undef SHIFT
408  #undef BASE
409  #undef MASK
410  #ifdef SIZEOF_VOID_P
411  enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
412  #endif
413 #endif
414 #ifndef __has_attribute
415  #define __has_attribute(x) 0
416 #endif
417 #ifndef __has_cpp_attribute
418  #define __has_cpp_attribute(x) 0
419 #endif
420 #ifndef CYTHON_RESTRICT
421  #if defined(__GNUC__)
422  #define CYTHON_RESTRICT __restrict__
423  #elif defined(_MSC_VER) && _MSC_VER >= 1400
424  #define CYTHON_RESTRICT __restrict
425  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
426  #define CYTHON_RESTRICT restrict
427  #else
428  #define CYTHON_RESTRICT
429  #endif
430 #endif
431 #ifndef CYTHON_UNUSED
432 # if defined(__GNUC__)
433 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
434 # define CYTHON_UNUSED __attribute__ ((__unused__))
435 # else
436 # define CYTHON_UNUSED
437 # endif
438 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
439 # define CYTHON_UNUSED __attribute__ ((__unused__))
440 # else
441 # define CYTHON_UNUSED
442 # endif
443 #endif
444 #ifndef CYTHON_MAYBE_UNUSED_VAR
445 # if defined(__cplusplus)
446  template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
447 # else
448 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
449 # endif
450 #endif
451 #ifndef CYTHON_NCP_UNUSED
452 # if CYTHON_COMPILING_IN_CPYTHON
453 # define CYTHON_NCP_UNUSED
454 # else
455 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
456 # endif
457 #endif
458 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
459 #ifdef _MSC_VER
460  #ifndef _MSC_STDINT_H_
461  #if _MSC_VER < 1300
462  typedef unsigned char uint8_t;
463  typedef unsigned int uint32_t;
464  #else
465  typedef unsigned __int8 uint8_t;
466  typedef unsigned __int32 uint32_t;
467  #endif
468  #endif
469 #else
470  #include <stdint.h>
471 #endif
472 #ifndef CYTHON_FALLTHROUGH
473  #if defined(__cplusplus) && __cplusplus >= 201103L
474  #if __has_cpp_attribute(fallthrough)
475  #define CYTHON_FALLTHROUGH [[fallthrough]]
476  #elif __has_cpp_attribute(clang::fallthrough)
477  #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
478  #elif __has_cpp_attribute(gnu::fallthrough)
479  #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
480  #endif
481  #endif
482  #ifndef CYTHON_FALLTHROUGH
483  #if __has_attribute(fallthrough)
484  #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
485  #else
486  #define CYTHON_FALLTHROUGH
487  #endif
488  #endif
489  #if defined(__clang__ ) && defined(__apple_build_version__)
490  #if __apple_build_version__ < 7000000
491  #undef CYTHON_FALLTHROUGH
492  #define CYTHON_FALLTHROUGH
493  #endif
494  #endif
495 #endif
496 
497 #ifndef __cplusplus
498  #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
499 #endif
500 #ifndef CYTHON_INLINE
501  #if defined(__clang__)
502  #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
503  #else
504  #define CYTHON_INLINE inline
505  #endif
506 #endif
507 template<typename T>
508 void __Pyx_call_destructor(T& x) {
509  x.~T();
510 }
511 template<typename T>
512 class __Pyx_FakeReference {
513  public:
514  __Pyx_FakeReference() : ptr(NULL) { }
515  __Pyx_FakeReference(const T& ref) : ptr(const_cast<T*>(&ref)) { }
516  T *operator->() { return ptr; }
517  T *operator&() { return ptr; }
518  operator T&() { return *ptr; }
519  template<typename U> bool operator ==(U other) { return *ptr == other; }
520  template<typename U> bool operator !=(U other) { return *ptr != other; }
521  private:
522  T *ptr;
523 };
524 
525 #define __PYX_BUILD_PY_SSIZE_T "n"
526 #define CYTHON_FORMAT_SSIZE_T "z"
527 #if PY_MAJOR_VERSION < 3
528  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
529  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
530  PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
531  #define __Pyx_DefaultClassType PyClass_Type
532 #else
533  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
534  #define __Pyx_DefaultClassType PyType_Type
535 #if PY_VERSION_HEX >= 0x030B00A1
536  static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int k, int l, int s, int f,
537  PyObject *code, PyObject *c, PyObject* n, PyObject *v,
538  PyObject *fv, PyObject *cell, PyObject* fn,
539  PyObject *name, int fline, PyObject *lnos) {
540  PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL;
541  PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *call_result=NULL, *empty=NULL;
542  const char *fn_cstr=NULL;
543  const char *name_cstr=NULL;
544  PyCodeObject* co=NULL;
545  PyObject *type, *value, *traceback;
546  PyErr_Fetch(&type, &value, &traceback);
547  if (!(kwds=PyDict_New())) goto end;
548  if (!(argcount=PyLong_FromLong(a))) goto end;
549  if (PyDict_SetItemString(kwds, "co_argcount", argcount) != 0) goto end;
550  if (!(posonlyargcount=PyLong_FromLong(0))) goto end;
551  if (PyDict_SetItemString(kwds, "co_posonlyargcount", posonlyargcount) != 0) goto end;
552  if (!(kwonlyargcount=PyLong_FromLong(k))) goto end;
553  if (PyDict_SetItemString(kwds, "co_kwonlyargcount", kwonlyargcount) != 0) goto end;
554  if (!(nlocals=PyLong_FromLong(l))) goto end;
555  if (PyDict_SetItemString(kwds, "co_nlocals", nlocals) != 0) goto end;
556  if (!(stacksize=PyLong_FromLong(s))) goto end;
557  if (PyDict_SetItemString(kwds, "co_stacksize", stacksize) != 0) goto end;
558  if (!(flags=PyLong_FromLong(f))) goto end;
559  if (PyDict_SetItemString(kwds, "co_flags", flags) != 0) goto end;
560  if (PyDict_SetItemString(kwds, "co_code", code) != 0) goto end;
561  if (PyDict_SetItemString(kwds, "co_consts", c) != 0) goto end;
562  if (PyDict_SetItemString(kwds, "co_names", n) != 0) goto end;
563  if (PyDict_SetItemString(kwds, "co_varnames", v) != 0) goto end;
564  if (PyDict_SetItemString(kwds, "co_freevars", fv) != 0) goto end;
565  if (PyDict_SetItemString(kwds, "co_cellvars", cell) != 0) goto end;
566  if (PyDict_SetItemString(kwds, "co_linetable", lnos) != 0) goto end;
567  if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL))) goto end;
568  if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL))) goto end;
569  if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline))) goto end;
570  if (!(replace = PyObject_GetAttrString((PyObject*)co, "replace"))) goto cleanup_code_too;
571  if (!(empty = PyTuple_New(0))) goto cleanup_code_too; // unfortunately __pyx_empty_tuple isn't available here
572  if (!(call_result = PyObject_Call(replace, empty, kwds))) goto cleanup_code_too;
573  Py_XDECREF((PyObject*)co);
574  co = (PyCodeObject*)call_result;
575  call_result = NULL;
576  if (0) {
577  cleanup_code_too:
578  Py_XDECREF((PyObject*)co);
579  co = NULL;
580  }
581  end:
582  Py_XDECREF(kwds);
583  Py_XDECREF(argcount);
584  Py_XDECREF(posonlyargcount);
585  Py_XDECREF(kwonlyargcount);
586  Py_XDECREF(nlocals);
587  Py_XDECREF(stacksize);
588  Py_XDECREF(replace);
589  Py_XDECREF(call_result);
590  Py_XDECREF(empty);
591  if (type) {
592  PyErr_Restore(type, value, traceback);
593  }
594  return co;
595  }
596 #else
597  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
598  PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
599 #endif
600  #define __Pyx_DefaultClassType PyType_Type
601 #endif
602 #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY
603  #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o)
604 #else
605  #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o)
606 #endif
607 #ifndef Py_TPFLAGS_CHECKTYPES
608  #define Py_TPFLAGS_CHECKTYPES 0
609 #endif
610 #ifndef Py_TPFLAGS_HAVE_INDEX
611  #define Py_TPFLAGS_HAVE_INDEX 0
612 #endif
613 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
614  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
615 #endif
616 #ifndef Py_TPFLAGS_HAVE_FINALIZE
617  #define Py_TPFLAGS_HAVE_FINALIZE 0
618 #endif
619 #ifndef METH_STACKLESS
620  #define METH_STACKLESS 0
621 #endif
622 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
623  #ifndef METH_FASTCALL
624  #define METH_FASTCALL 0x80
625  #endif
626  typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
627  typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
628  Py_ssize_t nargs, PyObject *kwnames);
629 #else
630  #define __Pyx_PyCFunctionFast _PyCFunctionFast
631  #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
632 #endif
633 #if CYTHON_FAST_PYCCALL
634 #define __Pyx_PyFastCFunction_Check(func)\
635  ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
636 #else
637 #define __Pyx_PyFastCFunction_Check(func) 0
638 #endif
639 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
640  #define PyObject_Malloc(s) PyMem_Malloc(s)
641  #define PyObject_Free(p) PyMem_Free(p)
642  #define PyObject_Realloc(p) PyMem_Realloc(p)
643 #endif
644 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
645  #define PyMem_RawMalloc(n) PyMem_Malloc(n)
646  #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
647  #define PyMem_RawFree(p) PyMem_Free(p)
648 #endif
649 #if CYTHON_COMPILING_IN_PYSTON
650  #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
651  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
652 #else
653  #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
654  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
655 #endif
656 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
657  #define __Pyx_PyThreadState_Current PyThreadState_GET()
658 #elif PY_VERSION_HEX >= 0x03060000
659  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
660 #elif PY_VERSION_HEX >= 0x03000000
661  #define __Pyx_PyThreadState_Current PyThreadState_GET()
662 #else
663  #define __Pyx_PyThreadState_Current _PyThreadState_Current
664 #endif
665 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
666 #include "pythread.h"
667 #define Py_tss_NEEDS_INIT 0
668 typedef int Py_tss_t;
669 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
670  *key = PyThread_create_key();
671  return 0;
672 }
673 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
674  Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
675  *key = Py_tss_NEEDS_INIT;
676  return key;
677 }
678 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
679  PyObject_Free(key);
680 }
681 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
682  return *key != Py_tss_NEEDS_INIT;
683 }
684 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
685  PyThread_delete_key(*key);
686  *key = Py_tss_NEEDS_INIT;
687 }
688 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
689  return PyThread_set_key_value(*key, value);
690 }
691 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
692  return PyThread_get_key_value(*key);
693 }
694 #endif
695 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
696 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
697 #else
698 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
699 #endif
700 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
701  #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
702  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
703 #else
704  #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
705  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
706 #endif
707 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
708 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
709 #else
710 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
711 #endif
712 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
713  #define CYTHON_PEP393_ENABLED 1
714  #if PY_VERSION_HEX >= 0x030C0000
715  #define __Pyx_PyUnicode_READY(op) (0)
716  #else
717  #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
718  0 : _PyUnicode_Ready((PyObject *)(op)))
719  #endif
720  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
721  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
722  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
723  #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
724  #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
725  #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
726  #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
727  #if PY_VERSION_HEX >= 0x030C0000
728  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
729  #else
730  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
731  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
732  #else
733  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
734  #endif
735  #endif
736 #else
737  #define CYTHON_PEP393_ENABLED 0
738  #define PyUnicode_1BYTE_KIND 1
739  #define PyUnicode_2BYTE_KIND 2
740  #define PyUnicode_4BYTE_KIND 4
741  #define __Pyx_PyUnicode_READY(op) (0)
742  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
743  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
744  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
745  #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
746  #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
747  #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
748  #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
749  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
750 #endif
751 #if CYTHON_COMPILING_IN_PYPY
752  #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
753  #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
754 #else
755  #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
756  #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
757  PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
758 #endif
759 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
760  #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
761 #endif
762 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
763  #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
764 #endif
765 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
766  #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
767 #endif
768 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
769 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
770 #if PY_MAJOR_VERSION >= 3
771  #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
772 #else
773  #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
774 #endif
775 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
776  #define PyObject_ASCII(o) PyObject_Repr(o)
777 #endif
778 #if PY_MAJOR_VERSION >= 3
779  #define PyBaseString_Type PyUnicode_Type
780  #define PyStringObject PyUnicodeObject
781  #define PyString_Type PyUnicode_Type
782  #define PyString_Check PyUnicode_Check
783  #define PyString_CheckExact PyUnicode_CheckExact
784 #ifndef PyObject_Unicode
785  #define PyObject_Unicode PyObject_Str
786 #endif
787 #endif
788 #if PY_MAJOR_VERSION >= 3
789  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
790  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
791 #else
792  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
793  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
794 #endif
795 #ifndef PySet_CheckExact
796  #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
797 #endif
798 #if PY_VERSION_HEX >= 0x030900A4
799  #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
800  #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
801 #else
802  #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
803  #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
804 #endif
805 #if CYTHON_ASSUME_SAFE_MACROS
806  #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
807 #else
808  #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
809 #endif
810 #if PY_MAJOR_VERSION >= 3
811  #define PyIntObject PyLongObject
812  #define PyInt_Type PyLong_Type
813  #define PyInt_Check(op) PyLong_Check(op)
814  #define PyInt_CheckExact(op) PyLong_CheckExact(op)
815  #define PyInt_FromString PyLong_FromString
816  #define PyInt_FromUnicode PyLong_FromUnicode
817  #define PyInt_FromLong PyLong_FromLong
818  #define PyInt_FromSize_t PyLong_FromSize_t
819  #define PyInt_FromSsize_t PyLong_FromSsize_t
820  #define PyInt_AsLong PyLong_AsLong
821  #define PyInt_AS_LONG PyLong_AS_LONG
822  #define PyInt_AsSsize_t PyLong_AsSsize_t
823  #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
824  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
825  #define PyNumber_Int PyNumber_Long
826 #endif
827 #if PY_MAJOR_VERSION >= 3
828  #define PyBoolObject PyLongObject
829 #endif
830 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
831  #ifndef PyUnicode_InternFromString
832  #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
833  #endif
834 #endif
835 #if PY_VERSION_HEX < 0x030200A4
836  typedef long Py_hash_t;
837  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
838  #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t
839 #else
840  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
841  #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t
842 #endif
843 #if PY_MAJOR_VERSION >= 3
844  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
845 #else
846  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
847 #endif
848 #if CYTHON_USE_ASYNC_SLOTS
849  #if PY_VERSION_HEX >= 0x030500B1
850  #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
851  #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
852  #else
853  #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
854  #endif
855 #else
856  #define __Pyx_PyType_AsAsync(obj) NULL
857 #endif
858 #ifndef __Pyx_PyAsyncMethodsStruct
859  typedef struct {
860  unaryfunc am_await;
861  unaryfunc am_aiter;
862  unaryfunc am_anext;
863  } __Pyx_PyAsyncMethodsStruct;
864 #endif
865 
866 #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
867  #if !defined(_USE_MATH_DEFINES)
868  #define _USE_MATH_DEFINES
869  #endif
870 #endif
871 #include <math.h>
872 #ifdef NAN
873 #define __PYX_NAN() ((float) NAN)
874 #else
875 static CYTHON_INLINE float __PYX_NAN() {
876  float value;
877  memset(&value, 0xFF, sizeof(value));
878  return value;
879 }
880 #endif
881 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
882 #define __Pyx_truncl trunc
883 #else
884 #define __Pyx_truncl truncl
885 #endif
886 
887 #define __PYX_MARK_ERR_POS(f_index, lineno) \
888  { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
889 #define __PYX_ERR(f_index, lineno, Ln_error) \
890  { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
891 
892 #ifndef __PYX_EXTERN_C
893  #ifdef __cplusplus
894  #define __PYX_EXTERN_C extern "C"
895  #else
896  #define __PYX_EXTERN_C extern
897  #endif
898 #endif
899 
900 #define __PYX_HAVE__imate___c_trace_estimator__py_c_trace_estimator
901 #define __PYX_HAVE_API__imate___c_trace_estimator__py_c_trace_estimator
902 /* Early includes */
903 #include "functions.h"
904 #include "identity.h"
905 #include "ios"
906 #include "new"
907 #include "stdexcept"
908 #include "typeinfo"
909 #include "indicator.h"
910 #include "inverse.h"
911 #include "homographic.h"
912 #include "logarithm.h"
913 #include "exponential.h"
914 #include "gaussian.h"
915 #include "smoothstep.h"
916 #include "./definitions.h"
917 #include "c_linear_operator.h"
918 #include <stdint.h>
919 #include <math.h>
920 #include <string.h>
921 #include <stdlib.h>
922 #include "c_trace_estimator.h"
923 #include "pythread.h"
924 #include <stdio.h>
925 #include "pystate.h"
926 #ifdef _OPENMP
927 #include <omp.h>
928 #endif /* _OPENMP */
929 
930 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
931 #define CYTHON_WITHOUT_ASSERTIONS
932 #endif
933 
934 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
935  const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
936 
937 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
938 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
939 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
940 #define __PYX_DEFAULT_STRING_ENCODING ""
941 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
942 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
943 #define __Pyx_uchar_cast(c) ((unsigned char)c)
944 #define __Pyx_long_cast(x) ((long)x)
945 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
946  (sizeof(type) < sizeof(Py_ssize_t)) ||\
947  (sizeof(type) > sizeof(Py_ssize_t) &&\
948  likely(v < (type)PY_SSIZE_T_MAX ||\
949  v == (type)PY_SSIZE_T_MAX) &&\
950  (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
951  v == (type)PY_SSIZE_T_MIN))) ||\
952  (sizeof(type) == sizeof(Py_ssize_t) &&\
953  (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
954  v == (type)PY_SSIZE_T_MAX))) )
955 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
956  return (size_t) i < (size_t) limit;
957 }
958 #if defined (__cplusplus) && __cplusplus >= 201103L
959  #include <cstdlib>
960  #define __Pyx_sst_abs(value) std::abs(value)
961 #elif SIZEOF_INT >= SIZEOF_SIZE_T
962  #define __Pyx_sst_abs(value) abs(value)
963 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
964  #define __Pyx_sst_abs(value) labs(value)
965 #elif defined (_MSC_VER)
966  #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
967 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
968  #define __Pyx_sst_abs(value) llabs(value)
969 #elif defined (__GNUC__)
970  #define __Pyx_sst_abs(value) __builtin_llabs(value)
971 #else
972  #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
973 #endif
974 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
975 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
976 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
977 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
978 #define __Pyx_PyBytes_FromString PyBytes_FromString
979 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
980 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
981 #if PY_MAJOR_VERSION < 3
982  #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
983  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
984 #else
985  #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
986  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
987 #endif
988 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
989 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
990 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
991 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
992 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
993 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
994 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
995 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
996 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
997 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
998 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
999 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
1000 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
1001 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
1002 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
1003 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
1004 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
1005  const Py_UNICODE *u_end = u;
1006  while (*u_end++) ;
1007  return (size_t)(u_end - u - 1);
1008 }
1009 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
1010 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
1011 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
1012 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
1013 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
1014 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
1015 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
1016 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
1017 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
1018 #define __Pyx_PySequence_Tuple(obj)\
1019  (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
1020 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
1021 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
1022 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
1023 #if CYTHON_ASSUME_SAFE_MACROS
1024 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
1025 #else
1026 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
1027 #endif
1028 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
1029 #if PY_MAJOR_VERSION >= 3
1030 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
1031 #else
1032 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
1033 #endif
1034 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
1035 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
1036 static int __Pyx_sys_getdefaultencoding_not_ascii;
1037 static int __Pyx_init_sys_getdefaultencoding_params(void) {
1038  PyObject* sys;
1039  PyObject* default_encoding = NULL;
1040  PyObject* ascii_chars_u = NULL;
1041  PyObject* ascii_chars_b = NULL;
1042  const char* default_encoding_c;
1043  sys = PyImport_ImportModule("sys");
1044  if (!sys) goto bad;
1045  default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
1046  Py_DECREF(sys);
1047  if (!default_encoding) goto bad;
1048  default_encoding_c = PyBytes_AsString(default_encoding);
1049  if (!default_encoding_c) goto bad;
1050  if (strcmp(default_encoding_c, "ascii") == 0) {
1051  __Pyx_sys_getdefaultencoding_not_ascii = 0;
1052  } else {
1053  char ascii_chars[128];
1054  int c;
1055  for (c = 0; c < 128; c++) {
1056  ascii_chars[c] = c;
1057  }
1058  __Pyx_sys_getdefaultencoding_not_ascii = 1;
1059  ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
1060  if (!ascii_chars_u) goto bad;
1061  ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
1062  if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
1063  PyErr_Format(
1064  PyExc_ValueError,
1065  "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
1066  default_encoding_c);
1067  goto bad;
1068  }
1069  Py_DECREF(ascii_chars_u);
1070  Py_DECREF(ascii_chars_b);
1071  }
1072  Py_DECREF(default_encoding);
1073  return 0;
1074 bad:
1075  Py_XDECREF(default_encoding);
1076  Py_XDECREF(ascii_chars_u);
1077  Py_XDECREF(ascii_chars_b);
1078  return -1;
1079 }
1080 #endif
1081 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
1082 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
1083 #else
1084 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
1085 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
1086 static char* __PYX_DEFAULT_STRING_ENCODING;
1087 static int __Pyx_init_sys_getdefaultencoding_params(void) {
1088  PyObject* sys;
1089  PyObject* default_encoding = NULL;
1090  char* default_encoding_c;
1091  sys = PyImport_ImportModule("sys");
1092  if (!sys) goto bad;
1093  default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
1094  Py_DECREF(sys);
1095  if (!default_encoding) goto bad;
1096  default_encoding_c = PyBytes_AsString(default_encoding);
1097  if (!default_encoding_c) goto bad;
1098  __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
1099  if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
1100  strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
1101  Py_DECREF(default_encoding);
1102  return 0;
1103 bad:
1104  Py_XDECREF(default_encoding);
1105  return -1;
1106 }
1107 #endif
1108 #endif
1109 
1110 
1111 /* Test for GCC > 2.95 */
1112 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
1113  #define likely(x) __builtin_expect(!!(x), 1)
1114  #define unlikely(x) __builtin_expect(!!(x), 0)
1115 #else /* !__GNUC__ or GCC < 2.95 */
1116  #define likely(x) (x)
1117  #define unlikely(x) (x)
1118 #endif /* __GNUC__ */
1119 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
1120 
1121 static PyObject *__pyx_m = NULL;
1122 static PyObject *__pyx_d;
1123 static PyObject *__pyx_b;
1124 static PyObject *__pyx_cython_runtime = NULL;
1125 static PyObject *__pyx_empty_tuple;
1126 static PyObject *__pyx_empty_bytes;
1127 static PyObject *__pyx_empty_unicode;
1128 static int __pyx_lineno;
1129 static int __pyx_clineno = 0;
1130 static const char * __pyx_cfilenm= __FILE__;
1131 static const char *__pyx_filename;
1132 
1133 /* Header.proto */
1134 #if !defined(CYTHON_CCOMPLEX)
1135  #if defined(__cplusplus)
1136  #define CYTHON_CCOMPLEX 1
1137  #elif defined(_Complex_I)
1138  #define CYTHON_CCOMPLEX 1
1139  #else
1140  #define CYTHON_CCOMPLEX 0
1141  #endif
1142 #endif
1143 #if CYTHON_CCOMPLEX
1144  #ifdef __cplusplus
1145  #include <complex>
1146  #else
1147  #include <complex.h>
1148  #endif
1149 #endif
1150 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
1151  #undef _Complex_I
1152  #define _Complex_I 1.0fj
1153 #endif
1154 
1155 
1156 static const char *__pyx_f[] = {
1157  "imate/_c_trace_estimator/py_c_trace_estimator.pyx",
1158  "imate/_c_trace_estimator/lapack_api.pxi",
1159  "stringsource",
1160  "imate/functions/py_functions.pxd",
1161  "imate/_c_linear_operator/py_c_linear_operator.pxd",
1162  "imate/_c_linear_operator/py_c_matrix.pxd",
1163  "imate/_c_linear_operator/py_c_affine_matrix_function.pxd",
1164 };
1165 /* MemviewSliceStruct.proto */
1166 struct __pyx_memoryview_obj;
1167 typedef struct {
1168  struct __pyx_memoryview_obj *memview;
1169  char *data;
1170  Py_ssize_t shape[8];
1171  Py_ssize_t strides[8];
1172  Py_ssize_t suboffsets[8];
1173 } __Pyx_memviewslice;
1174 #define __Pyx_MemoryView_Len(m) (m.shape[0])
1175 
1176 /* Atomics.proto */
1177 #include <pythread.h>
1178 #ifndef CYTHON_ATOMICS
1179  #define CYTHON_ATOMICS 1
1180 #endif
1181 #define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS
1182 #define __pyx_atomic_int_type int
1183 #if CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\
1184  (__GNUC_MINOR__ > 1 ||\
1185  (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2))))
1186  #define __pyx_atomic_incr_aligned(value) __sync_fetch_and_add(value, 1)
1187  #define __pyx_atomic_decr_aligned(value) __sync_fetch_and_sub(value, 1)
1188  #ifdef __PYX_DEBUG_ATOMICS
1189  #warning "Using GNU atomics"
1190  #endif
1191 #elif CYTHON_ATOMICS && defined(_MSC_VER) && CYTHON_COMPILING_IN_NOGIL
1192  #include <intrin.h>
1193  #undef __pyx_atomic_int_type
1194  #define __pyx_atomic_int_type long
1195  #pragma intrinsic (_InterlockedExchangeAdd)
1196  #define __pyx_atomic_incr_aligned(value) _InterlockedExchangeAdd(value, 1)
1197  #define __pyx_atomic_decr_aligned(value) _InterlockedExchangeAdd(value, -1)
1198  #ifdef __PYX_DEBUG_ATOMICS
1199  #pragma message ("Using MSVC atomics")
1200  #endif
1201 #else
1202  #undef CYTHON_ATOMICS
1203  #define CYTHON_ATOMICS 0
1204  #ifdef __PYX_DEBUG_ATOMICS
1205  #warning "Not using atomics"
1206  #endif
1207 #endif
1208 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
1209 #if CYTHON_ATOMICS
1210  #define __pyx_add_acquisition_count(memview)\
1211  __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview))
1212  #define __pyx_sub_acquisition_count(memview)\
1213  __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview))
1214 #else
1215  #define __pyx_add_acquisition_count(memview)\
1216  __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1217  #define __pyx_sub_acquisition_count(memview)\
1218  __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1219 #endif
1220 
1221 /* ForceInitThreads.proto */
1222 #ifndef __PYX_FORCE_INIT_THREADS
1223  #define __PYX_FORCE_INIT_THREADS 0
1224 #endif
1225 
1226 /* NoFastGil.proto */
1227 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
1228 #define __Pyx_PyGILState_Release PyGILState_Release
1229 #define __Pyx_FastGIL_Remember()
1230 #define __Pyx_FastGIL_Forget()
1231 #define __Pyx_FastGilFuncInit()
1232 
1233 /* BufferFormatStructs.proto */
1234 #define IS_UNSIGNED(type) (((type) -1) > 0)
1235 struct __Pyx_StructField_;
1236 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
1237 typedef struct {
1238  const char* name;
1239  struct __Pyx_StructField_* fields;
1240  size_t size;
1241  size_t arraysize[8];
1242  int ndim;
1243  char typegroup;
1244  char is_unsigned;
1245  int flags;
1246 } __Pyx_TypeInfo;
1247 typedef struct __Pyx_StructField_ {
1248  __Pyx_TypeInfo* type;
1249  const char* name;
1250  size_t offset;
1251 } __Pyx_StructField;
1252 typedef struct {
1253  __Pyx_StructField* field;
1254  size_t parent_offset;
1255 } __Pyx_BufFmt_StackElem;
1256 typedef struct {
1257  __Pyx_StructField root;
1258  __Pyx_BufFmt_StackElem* head;
1259  size_t fmt_offset;
1260  size_t new_count, enc_count;
1261  size_t struct_alignment;
1262  int is_complex;
1263  char enc_type;
1264  char new_packmode;
1265  char enc_packmode;
1266  char is_valid_array;
1267 } __Pyx_BufFmt_Context;
1268 
1269 
1270 /* "_definitions/types.pxd":110
1271  *
1272  * # Used for indices of small matrices, or small size iterators
1273  * ctypedef int IndexType # <<<<<<<<<<<<<<
1274  * ctypedef int[:] MemoryViewIndexType
1275  *
1276  */
1277 typedef int __pyx_t_5imate_12_definitions_5types_IndexType;
1278 
1279 /* "_definitions/types.pxd":114
1280  *
1281  * # Used for both flags and integers used as signals, including negative integers
1282  * ctypedef int FlagType # <<<<<<<<<<<<<<
1283  * ctypedef int[:] MemoryViewFlagType
1284  *
1285  */
1286 typedef int __pyx_t_5imate_12_definitions_5types_FlagType;
1287 
1288 /* "scipy/linalg/cython_lapack.pxd":15
1289  * # The original libraries should be linked directly.
1290  *
1291  * ctypedef float s # <<<<<<<<<<<<<<
1292  * ctypedef double d
1293  * ctypedef float complex c
1294  */
1295 typedef float __pyx_t_5scipy_6linalg_13cython_lapack_s;
1296 
1297 /* "scipy/linalg/cython_lapack.pxd":16
1298  *
1299  * ctypedef float s
1300  * ctypedef double d # <<<<<<<<<<<<<<
1301  * ctypedef float complex c
1302  * ctypedef double complex z
1303  */
1304 typedef double __pyx_t_5scipy_6linalg_13cython_lapack_d;
1305 
1306 /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":32
1307  *
1308  * # To avoid cython's bug that does not recognizes "long double" in template []
1309  * ctypedef long double long_double # <<<<<<<<<<<<<<
1310  *
1311  *
1312  */
1313 typedef long double __pyx_t_5imate_18_c_trace_estimator_20py_c_trace_estimator_long_double;
1314 /* Declarations.proto */
1315 #if CYTHON_CCOMPLEX
1316  #ifdef __cplusplus
1317  typedef ::std::complex< float > __pyx_t_float_complex;
1318  #else
1319  typedef float _Complex __pyx_t_float_complex;
1320  #endif
1321 #else
1322  typedef struct { float real, imag; } __pyx_t_float_complex;
1323 #endif
1324 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1325 
1326 /* Declarations.proto */
1327 #if CYTHON_CCOMPLEX
1328  #ifdef __cplusplus
1329  typedef ::std::complex< double > __pyx_t_double_complex;
1330  #else
1331  typedef double _Complex __pyx_t_double_complex;
1332  #endif
1333 #else
1334  typedef struct { double real, imag; } __pyx_t_double_complex;
1335 #endif
1336 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1337 
1338 
1339 /*--- Type declarations ---*/
1340 struct __pyx_obj_5imate_9functions_12py_functions_pyFunction;
1341 struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator;
1342 struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix;
1343 struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction;
1344 struct __pyx_array_obj;
1345 struct __pyx_MemviewEnum_obj;
1346 struct __pyx_memoryview_obj;
1347 struct __pyx_memoryviewslice_obj;
1348 
1349 /* "_definitions/types.pxd":107
1350  * ctypedef unsigned int[:] MemoryViewLongIndexType
1351  * ELSE:
1352  * ctypedef int[:] MemoryViewLongIndexType # <<<<<<<<<<<<<<
1353  *
1354  * # Used for indices of small matrices, or small size iterators
1355  */
1356 typedef __Pyx_memviewslice __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType;
1357 
1358 /* "_definitions/types.pxd":111
1359  * # Used for indices of small matrices, or small size iterators
1360  * ctypedef int IndexType
1361  * ctypedef int[:] MemoryViewIndexType # <<<<<<<<<<<<<<
1362  *
1363  * # Used for both flags and integers used as signals, including negative integers
1364  */
1365 typedef __Pyx_memviewslice __pyx_t_5imate_12_definitions_5types_MemoryViewIndexType;
1366 
1367 /* "_definitions/types.pxd":115
1368  * # Used for both flags and integers used as signals, including negative integers
1369  * ctypedef int FlagType
1370  * ctypedef int[:] MemoryViewFlagType # <<<<<<<<<<<<<<
1371  *
1372  *
1373  */
1374 typedef __Pyx_memviewslice __pyx_t_5imate_12_definitions_5types_MemoryViewFlagType;
1375 
1376 /* "_definitions/types.pxd":122
1377  * # ==============
1378  *
1379  * ctypedef double (*kernel_type)( # noqa: E211 # <<<<<<<<<<<<<<
1380  * const double x,
1381  * const double kernel_param) nogil
1382  */
1383 typedef double (*__pyx_t_5imate_12_definitions_5types_kernel_type)(double const , double const );
1384 
1385 /* "scipy/linalg/cython_lapack.pxd":22
1386  * # Function pointer type declarations for
1387  * # gees and gges families of functions.
1388  * ctypedef bint cselect1(c*) # <<<<<<<<<<<<<<
1389  * ctypedef bint cselect2(c*, c*)
1390  * ctypedef bint dselect2(d*, d*)
1391  */
1392 typedef int __pyx_t_5scipy_6linalg_13cython_lapack_cselect1(__pyx_t_float_complex *);
1393 
1394 /* "scipy/linalg/cython_lapack.pxd":23
1395  * # gees and gges families of functions.
1396  * ctypedef bint cselect1(c*)
1397  * ctypedef bint cselect2(c*, c*) # <<<<<<<<<<<<<<
1398  * ctypedef bint dselect2(d*, d*)
1399  * ctypedef bint dselect3(d*, d*, d*)
1400  */
1401 typedef int __pyx_t_5scipy_6linalg_13cython_lapack_cselect2(__pyx_t_float_complex *, __pyx_t_float_complex *);
1402 
1403 /* "scipy/linalg/cython_lapack.pxd":24
1404  * ctypedef bint cselect1(c*)
1405  * ctypedef bint cselect2(c*, c*)
1406  * ctypedef bint dselect2(d*, d*) # <<<<<<<<<<<<<<
1407  * ctypedef bint dselect3(d*, d*, d*)
1408  * ctypedef bint sselect2(s*, s*)
1409  */
1410 typedef int __pyx_t_5scipy_6linalg_13cython_lapack_dselect2(__pyx_t_5scipy_6linalg_13cython_lapack_d *, __pyx_t_5scipy_6linalg_13cython_lapack_d *);
1411 
1412 /* "scipy/linalg/cython_lapack.pxd":25
1413  * ctypedef bint cselect2(c*, c*)
1414  * ctypedef bint dselect2(d*, d*)
1415  * ctypedef bint dselect3(d*, d*, d*) # <<<<<<<<<<<<<<
1416  * ctypedef bint sselect2(s*, s*)
1417  * ctypedef bint sselect3(s*, s*, s*)
1418  */
1419 typedef int __pyx_t_5scipy_6linalg_13cython_lapack_dselect3(__pyx_t_5scipy_6linalg_13cython_lapack_d *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, __pyx_t_5scipy_6linalg_13cython_lapack_d *);
1420 
1421 /* "scipy/linalg/cython_lapack.pxd":26
1422  * ctypedef bint dselect2(d*, d*)
1423  * ctypedef bint dselect3(d*, d*, d*)
1424  * ctypedef bint sselect2(s*, s*) # <<<<<<<<<<<<<<
1425  * ctypedef bint sselect3(s*, s*, s*)
1426  * ctypedef bint zselect1(z*)
1427  */
1428 typedef int __pyx_t_5scipy_6linalg_13cython_lapack_sselect2(__pyx_t_5scipy_6linalg_13cython_lapack_s *, __pyx_t_5scipy_6linalg_13cython_lapack_s *);
1429 
1430 /* "scipy/linalg/cython_lapack.pxd":27
1431  * ctypedef bint dselect3(d*, d*, d*)
1432  * ctypedef bint sselect2(s*, s*)
1433  * ctypedef bint sselect3(s*, s*, s*) # <<<<<<<<<<<<<<
1434  * ctypedef bint zselect1(z*)
1435  * ctypedef bint zselect2(z*, z*)
1436  */
1437 typedef int __pyx_t_5scipy_6linalg_13cython_lapack_sselect3(__pyx_t_5scipy_6linalg_13cython_lapack_s *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, __pyx_t_5scipy_6linalg_13cython_lapack_s *);
1438 
1439 /* "scipy/linalg/cython_lapack.pxd":28
1440  * ctypedef bint sselect2(s*, s*)
1441  * ctypedef bint sselect3(s*, s*, s*)
1442  * ctypedef bint zselect1(z*) # <<<<<<<<<<<<<<
1443  * ctypedef bint zselect2(z*, z*)
1444  *
1445  */
1446 typedef int __pyx_t_5scipy_6linalg_13cython_lapack_zselect1(__pyx_t_double_complex *);
1447 
1448 /* "scipy/linalg/cython_lapack.pxd":29
1449  * ctypedef bint sselect3(s*, s*, s*)
1450  * ctypedef bint zselect1(z*)
1451  * ctypedef bint zselect2(z*, z*) # <<<<<<<<<<<<<<
1452  *
1453  * cdef void cbbcsd(char *jobu1, char *jobu2, char *jobv1t, char *jobv2t, char *trans, int *m, int *p, int *q, s *theta, s *phi, c *u1, int *ldu1, c *u2, int *ldu2, c *v1t, int *ldv1t, c *v2t, int *ldv2t, s *b11d, s *b11e, s *b12d, s *b12e, s *b21d, s *b21e, s *b22d, s *b22e, s *rwork, int *lrwork, int *info) noexcept nogil
1454  */
1455 typedef int __pyx_t_5scipy_6linalg_13cython_lapack_zselect2(__pyx_t_double_complex *, __pyx_t_double_complex *);
1456 
1457 /* "imate/functions/py_functions.pxd":20
1458  * # ============
1459  *
1460  * cdef class pyFunction(object): # <<<<<<<<<<<<<<
1461  *
1462  * # Member data
1463  */
1464 struct __pyx_obj_5imate_9functions_12py_functions_pyFunction {
1465  PyObject_HEAD
1466  struct __pyx_vtabstruct_5imate_9functions_12py_functions_pyFunction *__pyx_vtab;
1467  Function *matrix_function;
1468 };
1469 
1470 
1471 /* "imate/_c_linear_operator/py_c_linear_operator.pxd":23
1472  * # ===================
1473  *
1474  * cdef class pycLinearOperator(object): # <<<<<<<<<<<<<<
1475  *
1476  * # Attributes
1477  */
1478 struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator {
1479  PyObject_HEAD
1480  struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_vtab;
1481  cLinearOperator<float> *Aop_float;
1482  cLinearOperator<double> *Aop_double;
1483  cLinearOperator<long double> *Aop_long_double;
1484  char *data_type_name;
1485  char *long_index_type_name;
1486  __pyx_t_5imate_12_definitions_5types_IndexType num_parameters;
1487  PyObject *parameters;
1488 };
1489 
1490 
1491 /* "imate/_c_linear_operator/py_c_matrix.pxd":21
1492  * # =========
1493  *
1494  * cdef class pycMatrix(pycLinearOperator): # <<<<<<<<<<<<<<
1495  * cdef A_csr
1496  * cdef A_indices_copy
1497  */
1498 struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix {
1499  struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator __pyx_base;
1500  PyObject *A_csr;
1501  PyObject *A_indices_copy;
1502  PyObject *A_index_pointer_copy;
1503 };
1504 
1505 
1506 /* "imate/_c_linear_operator/py_c_affine_matrix_function.pxd":21
1507  * # ==========================
1508  *
1509  * cdef class pycAffineMatrixFunction(pycLinearOperator): # <<<<<<<<<<<<<<
1510  * cdef A_csr
1511  * cdef B_csr
1512  */
1513 struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction {
1514  struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator __pyx_base;
1515  PyObject *A_csr;
1516  PyObject *B_csr;
1517  PyObject *A_indices_copy;
1518  PyObject *A_index_pointer_copy;
1519  PyObject *B_indices_copy;
1520  PyObject *B_index_pointer_copy;
1521 };
1522 
1523 
1524 /* "View.MemoryView":106
1525  *
1526  * @cname("__pyx_array")
1527  * cdef class array: # <<<<<<<<<<<<<<
1528  *
1529  * cdef:
1530  */
1531 struct __pyx_array_obj {
1532  PyObject_HEAD
1533  struct __pyx_vtabstruct_array *__pyx_vtab;
1534  char *data;
1535  Py_ssize_t len;
1536  char *format;
1537  int ndim;
1538  Py_ssize_t *_shape;
1539  Py_ssize_t *_strides;
1540  Py_ssize_t itemsize;
1541  PyObject *mode;
1542  PyObject *_format;
1543  void (*callback_free_data)(void *);
1544  int free_data;
1545  int dtype_is_object;
1546 };
1547 
1548 
1549 /* "View.MemoryView":280
1550  *
1551  * @cname('__pyx_MemviewEnum')
1552  * cdef class Enum(object): # <<<<<<<<<<<<<<
1553  * cdef object name
1554  * def __init__(self, name):
1555  */
1556 struct __pyx_MemviewEnum_obj {
1557  PyObject_HEAD
1558  PyObject *name;
1559 };
1560 
1561 
1562 /* "View.MemoryView":331
1563  *
1564  * @cname('__pyx_memoryview')
1565  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1566  *
1567  * cdef object obj
1568  */
1569 struct __pyx_memoryview_obj {
1570  PyObject_HEAD
1571  struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1572  PyObject *obj;
1573  PyObject *_size;
1574  PyObject *_array_interface;
1575  PyThread_type_lock lock;
1576  __pyx_atomic_int acquisition_count[2];
1577  __pyx_atomic_int *acquisition_count_aligned_p;
1578  Py_buffer view;
1579  int flags;
1580  int dtype_is_object;
1581  __Pyx_TypeInfo *typeinfo;
1582 };
1583 
1584 
1585 /* "View.MemoryView":967
1586  *
1587  * @cname('__pyx_memoryviewslice')
1588  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1589  * "Internal class for passing memoryview slices to Python"
1590  *
1591  */
1592 struct __pyx_memoryviewslice_obj {
1593  struct __pyx_memoryview_obj __pyx_base;
1594  __Pyx_memviewslice from_slice;
1595  PyObject *from_object;
1596  PyObject *(*to_object_func)(char *);
1597  int (*to_dtype_func)(char *, PyObject *);
1598 };
1599 
1600 
1601 
1602 /* "imate/functions/py_functions.pxd":20
1603  * # ============
1604  *
1605  * cdef class pyFunction(object): # <<<<<<<<<<<<<<
1606  *
1607  * # Member data
1608  */
1609 
1610 struct __pyx_vtabstruct_5imate_9functions_12py_functions_pyFunction {
1611  void (*set_function)(struct __pyx_obj_5imate_9functions_12py_functions_pyFunction *, Function *);
1612  Function *(*get_function)(struct __pyx_obj_5imate_9functions_12py_functions_pyFunction *);
1613 };
1614 static struct __pyx_vtabstruct_5imate_9functions_12py_functions_pyFunction *__pyx_vtabptr_5imate_9functions_12py_functions_pyFunction;
1615 
1616 
1617 /* "imate/_c_linear_operator/py_c_linear_operator.pxd":23
1618  * # ===================
1619  *
1620  * cdef class pycLinearOperator(object): # <<<<<<<<<<<<<<
1621  *
1622  * # Attributes
1623  */
1624 
1625 struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator {
1626  LongIndexType (*get_num_rows)(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1627  LongIndexType (*get_num_columns)(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1628  cLinearOperator<float> *(*get_linear_operator_float)(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1629  cLinearOperator<double> *(*get_linear_operator_double)(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1630  cLinearOperator<long double> *(*get_linear_operator_long_double)(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1631  void (*dot)(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *, PyObject *, PyObject *, int __pyx_skip_dispatch);
1632  void (*transpose_dot)(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *, PyObject *, PyObject *, int __pyx_skip_dispatch);
1633 };
1634 static struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_vtabptr_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator;
1635 
1636 
1637 /* "imate/_c_linear_operator/py_c_matrix.pxd":21
1638  * # =========
1639  *
1640  * cdef class pycMatrix(pycLinearOperator): # <<<<<<<<<<<<<<
1641  * cdef A_csr
1642  * cdef A_indices_copy
1643  */
1644 
1645 struct __pyx_vtabstruct_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix {
1646  struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator __pyx_base;
1647 };
1648 static struct __pyx_vtabstruct_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_vtabptr_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix;
1649 
1650 
1651 /* "imate/_c_linear_operator/py_c_affine_matrix_function.pxd":21
1652  * # ==========================
1653  *
1654  * cdef class pycAffineMatrixFunction(pycLinearOperator): # <<<<<<<<<<<<<<
1655  * cdef A_csr
1656  * cdef B_csr
1657  */
1658 
1659 struct __pyx_vtabstruct_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction {
1660  struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator __pyx_base;
1661 };
1662 static struct __pyx_vtabstruct_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_vtabptr_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction;
1663 
1664 
1665 /* "View.MemoryView":106
1666  *
1667  * @cname("__pyx_array")
1668  * cdef class array: # <<<<<<<<<<<<<<
1669  *
1670  * cdef:
1671  */
1672 
1673 struct __pyx_vtabstruct_array {
1674  PyObject *(*get_memview)(struct __pyx_array_obj *);
1675 };
1676 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1677 
1678 
1679 /* "View.MemoryView":331
1680  *
1681  * @cname('__pyx_memoryview')
1682  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1683  *
1684  * cdef object obj
1685  */
1686 
1687 struct __pyx_vtabstruct_memoryview {
1688  char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
1689  PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
1690  PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1691  PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
1692  PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1693  PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
1694  PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
1695 };
1696 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1697 
1698 
1699 /* "View.MemoryView":967
1700  *
1701  * @cname('__pyx_memoryviewslice')
1702  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1703  * "Internal class for passing memoryview slices to Python"
1704  *
1705  */
1706 
1707 struct __pyx_vtabstruct__memoryviewslice {
1708  struct __pyx_vtabstruct_memoryview __pyx_base;
1709 };
1710 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1711 
1712 /* --- Runtime support code (head) --- */
1713 /* Refnanny.proto */
1714 #ifndef CYTHON_REFNANNY
1715  #define CYTHON_REFNANNY 0
1716 #endif
1717 #if CYTHON_REFNANNY
1718  typedef struct {
1719  void (*INCREF)(void*, PyObject*, int);
1720  void (*DECREF)(void*, PyObject*, int);
1721  void (*GOTREF)(void*, PyObject*, int);
1722  void (*GIVEREF)(void*, PyObject*, int);
1723  void* (*SetupContext)(const char*, int, const char*);
1724  void (*FinishContext)(void**);
1725  } __Pyx_RefNannyAPIStruct;
1726  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1727  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1728  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1729 #ifdef WITH_THREAD
1730  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1731  if (acquire_gil) {\
1732  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1733  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1734  PyGILState_Release(__pyx_gilstate_save);\
1735  } else {\
1736  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1737  }
1738 #else
1739  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1740  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1741 #endif
1742  #define __Pyx_RefNannyFinishContext()\
1743  __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1744  #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1745  #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1746  #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1747  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1748  #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1749  #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1750  #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1751  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1752 #else
1753  #define __Pyx_RefNannyDeclarations
1754  #define __Pyx_RefNannySetupContext(name, acquire_gil)
1755  #define __Pyx_RefNannyFinishContext()
1756  #define __Pyx_INCREF(r) Py_INCREF(r)
1757  #define __Pyx_DECREF(r) Py_DECREF(r)
1758  #define __Pyx_GOTREF(r)
1759  #define __Pyx_GIVEREF(r)
1760  #define __Pyx_XINCREF(r) Py_XINCREF(r)
1761  #define __Pyx_XDECREF(r) Py_XDECREF(r)
1762  #define __Pyx_XGOTREF(r)
1763  #define __Pyx_XGIVEREF(r)
1764 #endif
1765 #define __Pyx_XDECREF_SET(r, v) do {\
1766  PyObject *tmp = (PyObject *) r;\
1767  r = v; __Pyx_XDECREF(tmp);\
1768  } while (0)
1769 #define __Pyx_DECREF_SET(r, v) do {\
1770  PyObject *tmp = (PyObject *) r;\
1771  r = v; __Pyx_DECREF(tmp);\
1772  } while (0)
1773 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1774 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1775 
1776 /* PyObjectGetAttrStr.proto */
1777 #if CYTHON_USE_TYPE_SLOTS
1778 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1779 #else
1780 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1781 #endif
1782 
1783 /* GetBuiltinName.proto */
1784 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1785 
1786 /* PyThreadStateGet.proto */
1787 #if CYTHON_FAST_THREAD_STATE
1788 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1789 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1790 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1791 #else
1792 #define __Pyx_PyThreadState_declare
1793 #define __Pyx_PyThreadState_assign
1794 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1795 #endif
1796 
1797 /* PyErrFetchRestore.proto */
1798 #if CYTHON_FAST_THREAD_STATE
1799 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1800 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1801 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1802 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1803 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1804 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1805 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1806 #if CYTHON_COMPILING_IN_CPYTHON
1807 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1808 #else
1809 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1810 #endif
1811 #else
1812 #define __Pyx_PyErr_Clear() PyErr_Clear()
1813 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1814 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1815 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1816 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1817 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1818 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1819 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1820 #endif
1821 
1822 /* Profile.proto */
1823 #ifndef CYTHON_PROFILE
1824 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
1825  #define CYTHON_PROFILE 0
1826 #else
1827  #define CYTHON_PROFILE 1
1828 #endif
1829 #endif
1830 #ifndef CYTHON_TRACE_NOGIL
1831  #define CYTHON_TRACE_NOGIL 0
1832 #else
1833  #if CYTHON_TRACE_NOGIL && !defined(CYTHON_TRACE)
1834  #define CYTHON_TRACE 1
1835  #endif
1836 #endif
1837 #ifndef CYTHON_TRACE
1838  #define CYTHON_TRACE 0
1839 #endif
1840 #if CYTHON_TRACE
1841  #undef CYTHON_PROFILE_REUSE_FRAME
1842 #endif
1843 #ifndef CYTHON_PROFILE_REUSE_FRAME
1844  #define CYTHON_PROFILE_REUSE_FRAME 0
1845 #endif
1846 #if CYTHON_PROFILE || CYTHON_TRACE
1847  #include "compile.h"
1848  #include "frameobject.h"
1849  #include "traceback.h"
1850 #if PY_VERSION_HEX >= 0x030b00a6
1851  #ifndef Py_BUILD_CORE
1852  #define Py_BUILD_CORE 1
1853  #endif
1854  #include "internal/pycore_frame.h"
1855 #endif
1856  #if CYTHON_PROFILE_REUSE_FRAME
1857  #define CYTHON_FRAME_MODIFIER static
1858  #define CYTHON_FRAME_DEL(frame)
1859  #else
1860  #define CYTHON_FRAME_MODIFIER
1861  #define CYTHON_FRAME_DEL(frame) Py_CLEAR(frame)
1862  #endif
1863  #define __Pyx_TraceDeclarations\
1864  static PyCodeObject *__pyx_frame_code = NULL;\
1865  CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL;\
1866  int __Pyx_use_tracing = 0;
1867  #define __Pyx_TraceFrameInit(codeobj)\
1868  if (codeobj) __pyx_frame_code = (PyCodeObject*) codeobj;
1869 #if PY_VERSION_HEX >= 0x030b00a2
1870  #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
1871  (unlikely((tstate)->cframe->use_tracing) &&\
1872  (!(check_tracing) || !(tstate)->tracing) &&\
1873  (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
1874  #define __Pyx_EnterTracing(tstate) PyThreadState_EnterTracing(tstate)
1875  #define __Pyx_LeaveTracing(tstate) PyThreadState_LeaveTracing(tstate)
1876 #elif PY_VERSION_HEX >= 0x030a00b1
1877  #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
1878  (unlikely((tstate)->cframe->use_tracing) &&\
1879  (!(check_tracing) || !(tstate)->tracing) &&\
1880  (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
1881  #define __Pyx_EnterTracing(tstate)\
1882  do { tstate->tracing++; tstate->cframe->use_tracing = 0; } while (0)
1883  #define __Pyx_LeaveTracing(tstate)\
1884  do {\
1885  tstate->tracing--;\
1886  tstate->cframe->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\
1887  || tstate->c_profilefunc != NULL);\
1888  } while (0)
1889 #else
1890  #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
1891  (unlikely((tstate)->use_tracing) &&\
1892  (!(check_tracing) || !(tstate)->tracing) &&\
1893  (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
1894  #define __Pyx_EnterTracing(tstate)\
1895  do { tstate->tracing++; tstate->use_tracing = 0; } while (0)
1896  #define __Pyx_LeaveTracing(tstate)\
1897  do {\
1898  tstate->tracing--;\
1899  tstate->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\
1900  || tstate->c_profilefunc != NULL);\
1901  } while (0)
1902 #endif
1903  #ifdef WITH_THREAD
1904  #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\
1905  if (nogil) {\
1906  if (CYTHON_TRACE_NOGIL) {\
1907  PyThreadState *tstate;\
1908  PyGILState_STATE state = PyGILState_Ensure();\
1909  tstate = __Pyx_PyThreadState_Current;\
1910  if (__Pyx_IsTracing(tstate, 1, 1)) {\
1911  __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1912  }\
1913  PyGILState_Release(state);\
1914  if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1915  }\
1916  } else {\
1917  PyThreadState* tstate = PyThreadState_GET();\
1918  if (__Pyx_IsTracing(tstate, 1, 1)) {\
1919  __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1920  if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1921  }\
1922  }
1923  #else
1924  #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\
1925  { PyThreadState* tstate = PyThreadState_GET();\
1926  if (__Pyx_IsTracing(tstate, 1, 1)) {\
1927  __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1928  if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1929  }\
1930  }
1931  #endif
1932  #define __Pyx_TraceException()\
1933  if (likely(!__Pyx_use_tracing)); else {\
1934  PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1935  if (__Pyx_IsTracing(tstate, 0, 1)) {\
1936  __Pyx_EnterTracing(tstate);\
1937  PyObject *exc_info = __Pyx_GetExceptionTuple(tstate);\
1938  if (exc_info) {\
1939  if (CYTHON_TRACE && tstate->c_tracefunc)\
1940  tstate->c_tracefunc(\
1941  tstate->c_traceobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\
1942  tstate->c_profilefunc(\
1943  tstate->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\
1944  Py_DECREF(exc_info);\
1945  }\
1946  __Pyx_LeaveTracing(tstate);\
1947  }\
1948  }
1949  static void __Pyx_call_return_trace_func(PyThreadState *tstate, PyFrameObject *frame, PyObject *result) {
1950  PyObject *type, *value, *traceback;
1951  __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
1952  __Pyx_EnterTracing(tstate);
1953  if (CYTHON_TRACE && tstate->c_tracefunc)
1954  tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_RETURN, result);
1955  if (tstate->c_profilefunc)
1956  tstate->c_profilefunc(tstate->c_profileobj, frame, PyTrace_RETURN, result);
1957  CYTHON_FRAME_DEL(frame);
1958  __Pyx_LeaveTracing(tstate);
1959  __Pyx_ErrRestoreInState(tstate, type, value, traceback);
1960  }
1961  #ifdef WITH_THREAD
1962  #define __Pyx_TraceReturn(result, nogil)\
1963  if (likely(!__Pyx_use_tracing)); else {\
1964  if (nogil) {\
1965  if (CYTHON_TRACE_NOGIL) {\
1966  PyThreadState *tstate;\
1967  PyGILState_STATE state = PyGILState_Ensure();\
1968  tstate = __Pyx_PyThreadState_Current;\
1969  if (__Pyx_IsTracing(tstate, 0, 0)) {\
1970  __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1971  }\
1972  PyGILState_Release(state);\
1973  }\
1974  } else {\
1975  PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1976  if (__Pyx_IsTracing(tstate, 0, 0)) {\
1977  __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1978  }\
1979  }\
1980  }
1981  #else
1982  #define __Pyx_TraceReturn(result, nogil)\
1983  if (likely(!__Pyx_use_tracing)); else {\
1984  PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1985  if (__Pyx_IsTracing(tstate, 0, 0)) {\
1986  __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1987  }\
1988  }
1989  #endif
1990  static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno);
1991  static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, PyThreadState* tstate, const char *funcname, const char *srcfile, int firstlineno);
1992 #else
1993  #define __Pyx_TraceDeclarations
1994  #define __Pyx_TraceFrameInit(codeobj)
1995  #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error) if ((1)); else goto_error;
1996  #define __Pyx_TraceException()
1997  #define __Pyx_TraceReturn(result, nogil)
1998 #endif
1999 #if CYTHON_TRACE
2000  static int __Pyx_call_line_trace_func(PyThreadState *tstate, PyFrameObject *frame, int lineno) {
2001  int ret;
2002  PyObject *type, *value, *traceback;
2003  __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
2004  __Pyx_PyFrame_SetLineNumber(frame, lineno);
2005  __Pyx_EnterTracing(tstate);
2006  ret = tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_LINE, NULL);
2007  __Pyx_LeaveTracing(tstate);
2008  if (likely(!ret)) {
2009  __Pyx_ErrRestoreInState(tstate, type, value, traceback);
2010  } else {
2011  Py_XDECREF(type);
2012  Py_XDECREF(value);
2013  Py_XDECREF(traceback);
2014  }
2015  return ret;
2016  }
2017  #ifdef WITH_THREAD
2018  #define __Pyx_TraceLine(lineno, nogil, goto_error)\
2019  if (likely(!__Pyx_use_tracing)); else {\
2020  if (nogil) {\
2021  if (CYTHON_TRACE_NOGIL) {\
2022  int ret = 0;\
2023  PyThreadState *tstate;\
2024  PyGILState_STATE state = PyGILState_Ensure();\
2025  tstate = __Pyx_PyThreadState_Current;\
2026  if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
2027  ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
2028  }\
2029  PyGILState_Release(state);\
2030  if (unlikely(ret)) goto_error;\
2031  }\
2032  } else {\
2033  PyThreadState* tstate = __Pyx_PyThreadState_Current;\
2034  if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
2035  int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
2036  if (unlikely(ret)) goto_error;\
2037  }\
2038  }\
2039  }
2040  #else
2041  #define __Pyx_TraceLine(lineno, nogil, goto_error)\
2042  if (likely(!__Pyx_use_tracing)); else {\
2043  PyThreadState* tstate = __Pyx_PyThreadState_Current;\
2044  if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
2045  int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
2046  if (unlikely(ret)) goto_error;\
2047  }\
2048  }
2049  #endif
2050 #else
2051  #define __Pyx_TraceLine(lineno, nogil, goto_error) if ((1)); else goto_error;
2052 #endif
2053 
2054 /* WriteUnraisableException.proto */
2055 static void __Pyx_WriteUnraisable(const char *name, int clineno,
2056  int lineno, const char *filename,
2057  int full_traceback, int nogil);
2058 
2059 /* IncludeStringH.proto */
2060 #include <string.h>
2061 
2062 /* BytesEquals.proto */
2063 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
2064 
2065 /* MemviewSliceInit.proto */
2066 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
2067 #define __Pyx_MEMVIEW_DIRECT 1
2068 #define __Pyx_MEMVIEW_PTR 2
2069 #define __Pyx_MEMVIEW_FULL 4
2070 #define __Pyx_MEMVIEW_CONTIG 8
2071 #define __Pyx_MEMVIEW_STRIDED 16
2072 #define __Pyx_MEMVIEW_FOLLOW 32
2073 #define __Pyx_IS_C_CONTIG 1
2074 #define __Pyx_IS_F_CONTIG 2
2075 static int __Pyx_init_memviewslice(
2076  struct __pyx_memoryview_obj *memview,
2077  int ndim,
2078  __Pyx_memviewslice *memviewslice,
2079  int memview_is_new_reference);
2080 static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
2081  __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
2082 static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
2083  __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
2084 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
2085 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
2086 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
2087 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
2088 static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
2089 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int);
2090 
2091 /* PyObjectCall.proto */
2092 #if CYTHON_COMPILING_IN_CPYTHON
2093 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
2094 #else
2095 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
2096 #endif
2097 
2098 /* RaiseException.proto */
2099 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
2100 
2101 /* SetItemInt.proto */
2102 #define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2103  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2104  __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\
2105  (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\
2106  __Pyx_SetItemInt_Generic(o, to_py_func(i), v)))
2107 static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
2108 static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
2109  int is_list, int wraparound, int boundscheck);
2110 
2111 /* RaiseArgTupleInvalid.proto */
2112 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
2113  Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
2114 
2115 /* RaiseDoubleKeywords.proto */
2116 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
2117 
2118 /* ParseKeywords.proto */
2119 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
2120  PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
2121  const char* function_name);
2122 
2123 /* ArgTypeTest.proto */
2124 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
2125  ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
2126  __Pyx__ArgTypeTest(obj, type, name, exact))
2127 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
2128 
2129 /* PyDictVersioning.proto */
2130 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
2131 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
2132 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
2133 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
2134  (version_var) = __PYX_GET_DICT_VERSION(dict);\
2135  (cache_var) = (value);
2136 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
2137  static PY_UINT64_T __pyx_dict_version = 0;\
2138  static PyObject *__pyx_dict_cached_value = NULL;\
2139  if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
2140  (VAR) = __pyx_dict_cached_value;\
2141  } else {\
2142  (VAR) = __pyx_dict_cached_value = (LOOKUP);\
2143  __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
2144  }\
2145 }
2146 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
2147 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
2148 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
2149 #else
2150 #define __PYX_GET_DICT_VERSION(dict) (0)
2151 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
2152 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
2153 #endif
2154 
2155 /* GetModuleGlobalName.proto */
2156 #if CYTHON_USE_DICT_VERSIONS
2157 #define __Pyx_GetModuleGlobalName(var, name) do {\
2158  static PY_UINT64_T __pyx_dict_version = 0;\
2159  static PyObject *__pyx_dict_cached_value = NULL;\
2160  (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
2161  (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
2162  __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
2163 } while(0)
2164 #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\
2165  PY_UINT64_T __pyx_dict_version;\
2166  PyObject *__pyx_dict_cached_value;\
2167  (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
2168 } while(0)
2169 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
2170 #else
2171 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
2172 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
2173 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
2174 #endif
2175 
2176 /* PyCFunctionFastCall.proto */
2177 #if CYTHON_FAST_PYCCALL
2178 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
2179 #else
2180 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
2181 #endif
2182 
2183 /* PyFunctionFastCall.proto */
2184 #if CYTHON_FAST_PYCALL
2185 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
2186  __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
2187 #if 1 || PY_VERSION_HEX < 0x030600B1
2188 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
2189 #else
2190 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
2191 #endif
2192 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
2193  (sizeof(char [1 - 2*!(cond)]) - 1)
2194 #ifndef Py_MEMBER_SIZE
2195 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
2196 #endif
2197 #if CYTHON_FAST_PYCALL
2198  static size_t __pyx_pyframe_localsplus_offset = 0;
2199  #include "frameobject.h"
2200 #if PY_VERSION_HEX >= 0x030b00a6
2201  #ifndef Py_BUILD_CORE
2202  #define Py_BUILD_CORE 1
2203  #endif
2204  #include "internal/pycore_frame.h"
2205 #endif
2206  #define __Pxy_PyFrame_Initialize_Offsets()\
2207  ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
2208  (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
2209  #define __Pyx_PyFrame_GetLocalsplus(frame)\
2210  (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
2211 #endif // CYTHON_FAST_PYCALL
2212 #endif
2213 
2214 /* PyObjectCall2Args.proto */
2215 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
2216 
2217 /* PyObjectCallMethO.proto */
2218 #if CYTHON_COMPILING_IN_CPYTHON
2219 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
2220 #endif
2221 
2222 /* PyObjectCallOneArg.proto */
2223 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
2224 
2225 /* UnicodeEquals.proto */
2226 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
2227 
2228 /* StrEquals.proto */
2229 #if PY_MAJOR_VERSION >= 3
2230 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
2231 #else
2232 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
2233 #endif
2234 
2235 /* UnaryNegOverflows.proto */
2236 #define UNARY_NEG_WOULD_OVERFLOW(x)\
2237  (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
2238 
2239 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
2240 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
2241 /* GetAttr.proto */
2242 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
2243 
2244 /* GetItemInt.proto */
2245 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2246  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2247  __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
2248  (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
2249  __Pyx_GetItemInt_Generic(o, to_py_func(i))))
2250 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2251  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2252  __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
2253  (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
2254 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
2255  int wraparound, int boundscheck);
2256 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2257  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2258  __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
2259  (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
2260 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
2261  int wraparound, int boundscheck);
2262 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
2263 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
2264  int is_list, int wraparound, int boundscheck);
2265 
2266 /* ObjectGetItem.proto */
2267 #if CYTHON_USE_TYPE_SLOTS
2268 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
2269 #else
2270 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
2271 #endif
2272 
2273 /* decode_c_string_utf16.proto */
2274 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) {
2275  int byteorder = 0;
2276  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2277 }
2278 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) {
2279  int byteorder = -1;
2280  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2281 }
2282 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) {
2283  int byteorder = 1;
2284  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2285 }
2286 
2287 /* decode_c_string.proto */
2288 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
2289  const char* cstring, Py_ssize_t start, Py_ssize_t stop,
2290  const char* encoding, const char* errors,
2291  PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
2292 
2293 /* PyErrExceptionMatches.proto */
2294 #if CYTHON_FAST_THREAD_STATE
2295 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
2296 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
2297 #else
2298 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
2299 #endif
2300 
2301 /* GetAttr3.proto */
2302 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
2303 
2304 /* RaiseTooManyValuesToUnpack.proto */
2305 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
2306 
2307 /* RaiseNeedMoreValuesToUnpack.proto */
2308 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
2309 
2310 /* RaiseNoneIterError.proto */
2311 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
2312 
2313 /* ExtTypeTest.proto */
2314 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
2315 
2316 /* GetTopmostException.proto */
2317 #if CYTHON_USE_EXC_INFO_STACK
2318 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
2319 #endif
2320 
2321 /* SaveResetException.proto */
2322 #if CYTHON_FAST_THREAD_STATE
2323 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
2324 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2325 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
2326 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2327 #else
2328 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
2329 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
2330 #endif
2331 
2332 /* GetException.proto */
2333 #if CYTHON_FAST_THREAD_STATE
2334 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
2335 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2336 #else
2337 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
2338 #endif
2339 
2340 /* SwapException.proto */
2341 #if CYTHON_FAST_THREAD_STATE
2342 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
2343 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2344 #else
2345 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
2346 #endif
2347 
2348 /* Import.proto */
2349 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
2350 
2351 /* FastTypeChecks.proto */
2352 #if CYTHON_COMPILING_IN_CPYTHON
2353 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
2354 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
2355 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
2356 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
2357 #else
2358 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
2359 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
2360 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
2361 #endif
2362 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
2363 
2364 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
2365 /* ListCompAppend.proto */
2366 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2367 static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
2368  PyListObject* L = (PyListObject*) list;
2369  Py_ssize_t len = Py_SIZE(list);
2370  if (likely(L->allocated > len)) {
2371  Py_INCREF(x);
2372  PyList_SET_ITEM(list, len, x);
2373  __Pyx_SET_SIZE(list, len + 1);
2374  return 0;
2375  }
2376  return PyList_Append(list, x);
2377 }
2378 #else
2379 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
2380 #endif
2381 
2382 /* PyIntBinop.proto */
2383 #if !CYTHON_COMPILING_IN_PYPY
2384 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
2385 #else
2386 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
2387  (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
2388 #endif
2389 
2390 /* ListExtend.proto */
2391 static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
2392 #if CYTHON_COMPILING_IN_CPYTHON
2393  PyObject* none = _PyList_Extend((PyListObject*)L, v);
2394  if (unlikely(!none))
2395  return -1;
2396  Py_DECREF(none);
2397  return 0;
2398 #else
2399  return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
2400 #endif
2401 }
2402 
2403 /* ListAppend.proto */
2404 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2405 static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
2406  PyListObject* L = (PyListObject*) list;
2407  Py_ssize_t len = Py_SIZE(list);
2408  if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
2409  Py_INCREF(x);
2410  PyList_SET_ITEM(list, len, x);
2411  __Pyx_SET_SIZE(list, len + 1);
2412  return 0;
2413  }
2414  return PyList_Append(list, x);
2415 }
2416 #else
2417 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
2418 #endif
2419 
2420 /* AssertionsEnabled.proto */
2421 #define __Pyx_init_assertions_enabled()
2422 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
2423  #define __pyx_assertions_enabled() (1)
2424 #elif PY_VERSION_HEX < 0x03080000 || CYTHON_COMPILING_IN_PYPY || defined(Py_LIMITED_API)
2425  #define __pyx_assertions_enabled() (!Py_OptimizeFlag)
2426 #elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030900A6
2427  static int __pyx_assertions_enabled_flag;
2428  #define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag)
2429  #undef __Pyx_init_assertions_enabled
2430  static void __Pyx_init_assertions_enabled(void) {
2431  __pyx_assertions_enabled_flag = ! _PyInterpreterState_GetConfig(__Pyx_PyThreadState_Current->interp)->optimization_level;
2432  }
2433 #else
2434  #define __pyx_assertions_enabled() (!Py_OptimizeFlag)
2435 #endif
2436 
2437 /* None.proto */
2438 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
2439 
2440 /* PySequenceContains.proto */
2441 static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) {
2442  int result = PySequence_Contains(seq, item);
2443  return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
2444 }
2445 
2446 /* ImportFrom.proto */
2447 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
2448 
2449 /* HasAttr.proto */
2450 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
2451 
2452 /* PyObject_GenericGetAttrNoDict.proto */
2453 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2454 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
2455 #else
2456 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
2457 #endif
2458 
2459 /* PyObject_GenericGetAttr.proto */
2460 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2461 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
2462 #else
2463 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
2464 #endif
2465 
2466 /* SetVTable.proto */
2467 static int __Pyx_SetVtable(PyObject *dict, void *vtable);
2468 
2469 /* PyObjectGetAttrStrNoError.proto */
2470 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
2471 
2472 /* SetupReduce.proto */
2473 static int __Pyx_setup_reduce(PyObject* type_obj);
2474 
2475 /* TypeImport.proto */
2476 #ifndef __PYX_HAVE_RT_ImportType_proto_0_29_36
2477 #define __PYX_HAVE_RT_ImportType_proto_0_29_36
2478 #if __STDC_VERSION__ >= 201112L
2479 #include <stdalign.h>
2480 #endif
2481 #if __STDC_VERSION__ >= 201112L || __cplusplus >= 201103L
2482 #define __PYX_GET_STRUCT_ALIGNMENT_0_29_36(s) alignof(s)
2483 #else
2484 #define __PYX_GET_STRUCT_ALIGNMENT_0_29_36(s) sizeof(void*)
2485 #endif
2486 enum __Pyx_ImportType_CheckSize_0_29_36 {
2487  __Pyx_ImportType_CheckSize_Error_0_29_36 = 0,
2488  __Pyx_ImportType_CheckSize_Warn_0_29_36 = 1,
2489  __Pyx_ImportType_CheckSize_Ignore_0_29_36 = 2
2490 };
2491 static PyTypeObject *__Pyx_ImportType_0_29_36(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_0_29_36 check_size);
2492 #endif
2493 
2494 /* GetVTable.proto */
2495 static void* __Pyx_GetVtable(PyObject *dict);
2496 
2497 /* FetchCommonType.proto */
2498 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
2499 
2500 /* CythonFunctionShared.proto */
2501 #define __Pyx_CyFunction_USED 1
2502 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
2503 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
2504 #define __Pyx_CYFUNCTION_CCLASS 0x04
2505 #define __Pyx_CyFunction_GetClosure(f)\
2506  (((__pyx_CyFunctionObject *) (f))->func_closure)
2507 #define __Pyx_CyFunction_GetClassObj(f)\
2508  (((__pyx_CyFunctionObject *) (f))->func_classobj)
2509 #define __Pyx_CyFunction_Defaults(type, f)\
2510  ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
2511 #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
2512  ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
2513 typedef struct {
2514  PyCFunctionObject func;
2515 #if PY_VERSION_HEX < 0x030500A0
2516  PyObject *func_weakreflist;
2517 #endif
2518  PyObject *func_dict;
2519  PyObject *func_name;
2520  PyObject *func_qualname;
2521  PyObject *func_doc;
2522  PyObject *func_globals;
2523  PyObject *func_code;
2524  PyObject *func_closure;
2525  PyObject *func_classobj;
2526  void *defaults;
2527  int defaults_pyobjects;
2528  size_t defaults_size; // used by FusedFunction for copying defaults
2529  int flags;
2530  PyObject *defaults_tuple;
2531  PyObject *defaults_kwdict;
2532  PyObject *(*defaults_getter)(PyObject *);
2533  PyObject *func_annotations;
2534 } __pyx_CyFunctionObject;
2535 static PyTypeObject *__pyx_CyFunctionType = 0;
2536 #define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
2537 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
2538  int flags, PyObject* qualname,
2539  PyObject *self,
2540  PyObject *module, PyObject *globals,
2541  PyObject* code);
2542 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
2543  size_t size,
2544  int pyobjects);
2545 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
2546  PyObject *tuple);
2547 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
2548  PyObject *dict);
2549 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
2550  PyObject *dict);
2551 static int __pyx_CyFunction_init(void);
2552 
2553 /* CythonFunction.proto */
2554 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
2555  int flags, PyObject* qualname,
2556  PyObject *closure,
2557  PyObject *module, PyObject *globals,
2558  PyObject* code);
2559 
2560 /* CLineInTraceback.proto */
2561 #ifdef CYTHON_CLINE_IN_TRACEBACK
2562 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2563 #else
2564 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
2565 #endif
2566 
2567 /* CodeObjectCache.proto */
2568 typedef struct {
2569  PyCodeObject* code_object;
2570  int code_line;
2571 } __Pyx_CodeObjectCacheEntry;
2572 struct __Pyx_CodeObjectCache {
2573  int count;
2574  int max_count;
2575  __Pyx_CodeObjectCacheEntry* entries;
2576 };
2577 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
2578 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
2579 static PyCodeObject *__pyx_find_code_object(int code_line);
2580 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
2581 
2582 /* AddTraceback.proto */
2583 static void __Pyx_AddTraceback(const char *funcname, int c_line,
2584  int py_line, const char *filename);
2585 
2586 #if PY_MAJOR_VERSION < 3
2587  static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
2588  static void __Pyx_ReleaseBuffer(Py_buffer *view);
2589 #else
2590  #define __Pyx_GetBuffer PyObject_GetBuffer
2591  #define __Pyx_ReleaseBuffer PyBuffer_Release
2592 #endif
2593 
2594 
2595 /* BufferStructDeclare.proto */
2596 typedef struct {
2597  Py_ssize_t shape, strides, suboffsets;
2598 } __Pyx_Buf_DimInfo;
2599 typedef struct {
2600  size_t refcount;
2601  Py_buffer pybuffer;
2602 } __Pyx_Buffer;
2603 typedef struct {
2604  __Pyx_Buffer *rcbuffer;
2605  char *data;
2606  __Pyx_Buf_DimInfo diminfo[8];
2607 } __Pyx_LocalBuf_ND;
2608 
2609 /* MemviewSliceIsContig.proto */
2610 static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim);
2611 
2612 /* OverlappingSlices.proto */
2613 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
2614  __Pyx_memviewslice *slice2,
2615  int ndim, size_t itemsize);
2616 
2617 /* Capsule.proto */
2618 static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);
2619 
2620 /* GCCDiagnostics.proto */
2621 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
2622 #define __Pyx_HAS_GCC_DIAGNOSTIC
2623 #endif
2624 
2625 /* IsLittleEndian.proto */
2626 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);
2627 
2628 /* BufferFormatCheck.proto */
2629 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
2630 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
2631  __Pyx_BufFmt_StackElem* stack,
2632  __Pyx_TypeInfo* type);
2633 
2634 /* TypeInfoCompare.proto */
2635 static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
2636 
2637 /* MemviewSliceValidateAndInit.proto */
2638 static int __Pyx_ValidateAndInit_memviewslice(
2639  int *axes_specs,
2640  int c_or_f_flag,
2641  int buf_flags,
2642  int ndim,
2643  __Pyx_TypeInfo *dtype,
2644  __Pyx_BufFmt_StackElem stack[],
2645  __Pyx_memviewslice *memviewslice,
2646  PyObject *original_obj);
2647 
2648 /* ObjectToMemviewSlice.proto */
2649 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_float(PyObject *, int writable_flag);
2650 
2651 /* ObjectToMemviewSlice.proto */
2652 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_float(PyObject *, int writable_flag);
2653 
2654 /* ObjectToMemviewSlice.proto */
2655 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject *, int writable_flag);
2656 
2657 /* ObjectToMemviewSlice.proto */
2658 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *, int writable_flag);
2659 
2660 /* ObjectToMemviewSlice.proto */
2661 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(PyObject *, int writable_flag);
2662 
2663 /* ObjectToMemviewSlice.proto */
2664 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(PyObject *, int writable_flag);
2665 
2666 /* ObjectToMemviewSlice.proto */
2667 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_long__double(PyObject *, int writable_flag);
2668 
2669 /* RealImag.proto */
2670 #if CYTHON_CCOMPLEX
2671  #ifdef __cplusplus
2672  #define __Pyx_CREAL(z) ((z).real())
2673  #define __Pyx_CIMAG(z) ((z).imag())
2674  #else
2675  #define __Pyx_CREAL(z) (__real__(z))
2676  #define __Pyx_CIMAG(z) (__imag__(z))
2677  #endif
2678 #else
2679  #define __Pyx_CREAL(z) ((z).real)
2680  #define __Pyx_CIMAG(z) ((z).imag)
2681 #endif
2682 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
2683  && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
2684  #define __Pyx_SET_CREAL(z,x) ((z).real(x))
2685  #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
2686 #else
2687  #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
2688  #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
2689 #endif
2690 
2691 /* Arithmetic.proto */
2692 #if CYTHON_CCOMPLEX
2693  #define __Pyx_c_eq_float(a, b) ((a)==(b))
2694  #define __Pyx_c_sum_float(a, b) ((a)+(b))
2695  #define __Pyx_c_diff_float(a, b) ((a)-(b))
2696  #define __Pyx_c_prod_float(a, b) ((a)*(b))
2697  #define __Pyx_c_quot_float(a, b) ((a)/(b))
2698  #define __Pyx_c_neg_float(a) (-(a))
2699  #ifdef __cplusplus
2700  #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
2701  #define __Pyx_c_conj_float(z) (::std::conj(z))
2702  #if 1
2703  #define __Pyx_c_abs_float(z) (::std::abs(z))
2704  #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
2705  #endif
2706  #else
2707  #define __Pyx_c_is_zero_float(z) ((z)==0)
2708  #define __Pyx_c_conj_float(z) (conjf(z))
2709  #if 1
2710  #define __Pyx_c_abs_float(z) (cabsf(z))
2711  #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
2712  #endif
2713  #endif
2714 #else
2715  static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
2716  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
2717  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
2718  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
2719  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
2720  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
2721  static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
2722  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
2723  #if 1
2724  static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
2725  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
2726  #endif
2727 #endif
2728 
2729 /* Arithmetic.proto */
2730 #if CYTHON_CCOMPLEX
2731  #define __Pyx_c_eq_double(a, b) ((a)==(b))
2732  #define __Pyx_c_sum_double(a, b) ((a)+(b))
2733  #define __Pyx_c_diff_double(a, b) ((a)-(b))
2734  #define __Pyx_c_prod_double(a, b) ((a)*(b))
2735  #define __Pyx_c_quot_double(a, b) ((a)/(b))
2736  #define __Pyx_c_neg_double(a) (-(a))
2737  #ifdef __cplusplus
2738  #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
2739  #define __Pyx_c_conj_double(z) (::std::conj(z))
2740  #if 1
2741  #define __Pyx_c_abs_double(z) (::std::abs(z))
2742  #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
2743  #endif
2744  #else
2745  #define __Pyx_c_is_zero_double(z) ((z)==0)
2746  #define __Pyx_c_conj_double(z) (conj(z))
2747  #if 1
2748  #define __Pyx_c_abs_double(z) (cabs(z))
2749  #define __Pyx_c_pow_double(a, b) (cpow(a, b))
2750  #endif
2751  #endif
2752 #else
2753  static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
2754  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
2755  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
2756  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
2757  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
2758  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
2759  static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
2760  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
2761  #if 1
2762  static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
2763  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
2764  #endif
2765 #endif
2766 
2767 /* MemviewSliceCopyTemplate.proto */
2768 static __Pyx_memviewslice
2769 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
2770  const char *mode, int ndim,
2771  size_t sizeof_dtype, int contig_flag,
2772  int dtype_is_object);
2773 
2774 /* CIntFromPy.proto */
2775 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
2776 
2777 /* CIntFromPy.proto */
2778 static CYTHON_INLINE int64_t __Pyx_PyInt_As_int64_t(PyObject *);
2779 
2780 /* CIntToPy.proto */
2781 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
2782 
2783 /* CIntToPy.proto */
2784 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
2785 
2786 /* CIntFromPy.proto */
2787 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
2788 
2789 /* CIntFromPy.proto */
2790 static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
2791 
2792 /* CheckBinaryVersion.proto */
2793 static int __Pyx_check_binary_version(void);
2794 
2795 /* FunctionExport.proto */
2796 static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig);
2797 
2798 /* FunctionImport.proto */
2799 static int __Pyx_ImportFunction_0_29_36(PyObject *module, const char *funcname, void (**f)(void), const char *sig);
2800 
2801 /* InitStrings.proto */
2802 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2803 
2804 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/
2805 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
2806 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
2807 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
2808 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value); /* proto*/
2809 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
2810 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2811 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2812 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2813 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2814 
2815 /* Module declarations from 'imate.functions.functions' */
2816 
2817 /* Module declarations from 'imate.functions.py_functions' */
2818 static PyTypeObject *__pyx_ptype_5imate_9functions_12py_functions_pyFunction = 0;
2819 
2820 /* Module declarations from 'imate.functions' */
2821 
2822 /* Module declarations from 'imate._definitions.types' */
2823 
2824 /* Module declarations from 'imate._c_linear_operator.c_linear_operator' */
2825 
2826 /* Module declarations from 'imate._c_linear_operator.py_c_linear_operator' */
2827 static PyTypeObject *__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator = 0;
2828 
2829 /* Module declarations from 'imate._c_linear_operator.py_c_matrix' */
2830 static PyTypeObject *__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix = 0;
2831 
2832 /* Module declarations from 'imate._c_linear_operator.py_c_affine_matrix_function' */
2833 static PyTypeObject *__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction = 0;
2834 
2835 /* Module declarations from 'imate._c_linear_operator' */
2836 
2837 /* Module declarations from 'libc.stdint' */
2838 
2839 /* Module declarations from 'libc.math' */
2840 
2841 /* Module declarations from 'libc.string' */
2842 
2843 /* Module declarations from 'libc.stdlib' */
2844 
2845 /* Module declarations from 'imate._c_trace_estimator.c_trace_estimator' */
2846 
2847 /* Module declarations from 'scipy.linalg.cython_lapack' */
2848 static void (*__pyx_f_5scipy_6linalg_13cython_lapack_dbdsdc)(char *, char *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, int *, int *); /*proto*/
2849 static void (*__pyx_f_5scipy_6linalg_13cython_lapack_dstev)(char *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, int *); /*proto*/
2850 static void (*__pyx_f_5scipy_6linalg_13cython_lapack_sbdsdc)(char *, char *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, int *, int *); /*proto*/
2851 static void (*__pyx_f_5scipy_6linalg_13cython_lapack_sstev)(char *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, int *); /*proto*/
2852 
2853 /* Module declarations from 'imate._c_trace_estimator.py_c_trace_estimator' */
2854 static PyTypeObject *__pyx_array_type = 0;
2855 static PyTypeObject *__pyx_MemviewEnum_type = 0;
2856 static PyTypeObject *__pyx_memoryview_type = 0;
2857 static PyTypeObject *__pyx_memoryviewslice_type = 0;
2858 static PyObject *generic = 0;
2859 static PyObject *strided = 0;
2860 static PyObject *indirect = 0;
2861 static PyObject *contiguous = 0;
2862 static PyObject *indirect_contiguous = 0;
2863 static int __pyx_memoryview_thread_locks_used;
2864 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
2865 static __pyx_t_5imate_12_definitions_5types_FlagType __pyx_f_5imate_18_c_trace_estimator_20py_c_trace_estimator_pyc_trace_estimator(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *, PyObject *, PyObject *, struct __pyx_obj_5imate_9functions_12py_functions_pyFunction *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch); /*proto*/
2866 __PYX_EXTERN_C void lapack_sstev(char *, int *, float *, float *, float *, int *, float *, int *); /*proto*/
2867 __PYX_EXTERN_C void lapack_dstev(char *, int *, double *, double *, double *, int *, double *, int *); /*proto*/
2868 __PYX_EXTERN_C void lapack_sbdsdc(char *, char *, int *, float *, float *, float *, int *, float *, int *, float *, int *, float *, int *, int *); /*proto*/
2869 __PYX_EXTERN_C void lapack_dbdsdc(char *, char *, int *, double *, double *, double *, int *, double *, int *, double *, int *, double *, int *, int *); /*proto*/
2870 static __pyx_t_5imate_12_definitions_5types_FlagType __pyx_f_5imate_18_c_trace_estimator_20py_c_trace_estimator__pyc_trace_estimator_float(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *, PyObject *, __pyx_t_5imate_12_definitions_5types_IndexType const , struct __pyx_obj_5imate_9functions_12py_functions_pyFunction *, __pyx_t_5imate_12_definitions_5types_FlagType const , float const , __pyx_t_5imate_12_definitions_5types_FlagType const , int64_t const , __pyx_t_5imate_12_definitions_5types_IndexType const , float const , __pyx_t_5imate_12_definitions_5types_IndexType const , __pyx_t_5imate_12_definitions_5types_IndexType const , float const , float const , float const , float const , __pyx_t_5imate_12_definitions_5types_IndexType const , __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __pyx_t_5imate_12_definitions_5types_MemoryViewIndexType, __pyx_t_5imate_12_definitions_5types_MemoryViewIndexType, __pyx_t_5imate_12_definitions_5types_MemoryViewIndexType, __pyx_t_5imate_12_definitions_5types_MemoryViewFlagType, float &); /*proto*/
2871 static __pyx_t_5imate_12_definitions_5types_FlagType __pyx_f_5imate_18_c_trace_estimator_20py_c_trace_estimator__pyc_trace_estimator_double(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *, PyObject *, __pyx_t_5imate_12_definitions_5types_IndexType const , struct __pyx_obj_5imate_9functions_12py_functions_pyFunction *, __pyx_t_5imate_12_definitions_5types_FlagType const , double const , __pyx_t_5imate_12_definitions_5types_FlagType const , int64_t const , __pyx_t_5imate_12_definitions_5types_IndexType const , double const , __pyx_t_5imate_12_definitions_5types_IndexType const , __pyx_t_5imate_12_definitions_5types_IndexType const , double const , double const , double const , double const , __pyx_t_5imate_12_definitions_5types_IndexType const , __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __pyx_t_5imate_12_definitions_5types_MemoryViewIndexType, __pyx_t_5imate_12_definitions_5types_MemoryViewIndexType, __pyx_t_5imate_12_definitions_5types_MemoryViewIndexType, __pyx_t_5imate_12_definitions_5types_MemoryViewFlagType, float &); /*proto*/
2872 static __pyx_t_5imate_12_definitions_5types_FlagType __pyx_f_5imate_18_c_trace_estimator_20py_c_trace_estimator__pyc_trace_estimator_long_double(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *, PyObject *, __pyx_t_5imate_12_definitions_5types_IndexType const , struct __pyx_obj_5imate_9functions_12py_functions_pyFunction *, __pyx_t_5imate_12_definitions_5types_FlagType const , long double const , __pyx_t_5imate_12_definitions_5types_FlagType const , int64_t const , __pyx_t_5imate_12_definitions_5types_IndexType const , long double const , __pyx_t_5imate_12_definitions_5types_IndexType const , __pyx_t_5imate_12_definitions_5types_IndexType const , long double const , long double const , long double const , long double const , __pyx_t_5imate_12_definitions_5types_IndexType const , __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __pyx_t_5imate_12_definitions_5types_MemoryViewIndexType, __pyx_t_5imate_12_definitions_5types_MemoryViewIndexType, __pyx_t_5imate_12_definitions_5types_MemoryViewIndexType, __pyx_t_5imate_12_definitions_5types_MemoryViewFlagType, float &); /*proto*/
2873 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
2874 static void *__pyx_align_pointer(void *, size_t); /*proto*/
2875 static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/
2876 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
2877 static PyObject *_unellipsify(PyObject *, int); /*proto*/
2878 static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
2879 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
2880 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int, int); /*proto*/
2881 static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
2882 static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
2883 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
2884 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2885 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2886 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
2887 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2888 static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
2889 static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
2890 static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
2891 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
2892 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
2893 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
2894 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
2895 static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
2896 static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/
2897 static int __pyx_memoryview_err(PyObject *, char *); /*proto*/
2898 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
2899 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
2900 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
2901 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2902 static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2903 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
2904 static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
2905 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/
2906 static __Pyx_TypeInfo __Pyx_TypeInfo_float = { "float", NULL, sizeof(float), { 0 }, 0, 'R', 0, 0 };
2907 static __Pyx_TypeInfo __Pyx_TypeInfo_int = { "int", NULL, sizeof(int), { 0 }, 0, IS_UNSIGNED(int) ? 'U' : 'I', IS_UNSIGNED(int), 0 };
2908 static __Pyx_TypeInfo __Pyx_TypeInfo_double = { "double", NULL, sizeof(double), { 0 }, 0, 'R', 0, 0 };
2909 static __Pyx_TypeInfo __Pyx_TypeInfo_long__double = { "long double", NULL, sizeof(long double), { 0 }, 0, 'R', 0, 0 };
2910 #define __Pyx_MODULE_NAME "imate._c_trace_estimator.py_c_trace_estimator"
2911 extern int __pyx_module_is_main_imate___c_trace_estimator__py_c_trace_estimator;
2912 int __pyx_module_is_main_imate___c_trace_estimator__py_c_trace_estimator = 0;
2913 
2914 /* Implementation of 'imate._c_trace_estimator.py_c_trace_estimator' */
2915 static PyObject *__pyx_builtin_TypeError;
2916 static PyObject *__pyx_builtin_range;
2917 static PyObject *__pyx_builtin_ValueError;
2918 static PyObject *__pyx_builtin_MemoryError;
2919 static PyObject *__pyx_builtin_enumerate;
2920 static PyObject *__pyx_builtin_Ellipsis;
2921 static PyObject *__pyx_builtin_id;
2922 static PyObject *__pyx_builtin_IndexError;
2923 static const char __pyx_k_O[] = "O";
2924 static const char __pyx_k_c[] = "c";
2925 static const char __pyx_k_id[] = "id";
2926 static const char __pyx_k_Aop[] = "Aop";
2927 static const char __pyx_k_new[] = "__new__";
2928 static const char __pyx_k_obj[] = "obj";
2929 static const char __pyx_k_base[] = "base";
2930 static const char __pyx_k_dict[] = "__dict__";
2931 static const char __pyx_k_gram[] = "gram";
2932 static const char __pyx_k_main[] = "__main__";
2933 static const char __pyx_k_mode[] = "mode";
2934 static const char __pyx_k_name[] = "name";
2935 static const char __pyx_k_ndim[] = "ndim";
2936 static const char __pyx_k_pack[] = "pack";
2937 static const char __pyx_k_seed[] = "seed";
2938 static const char __pyx_k_size[] = "size";
2939 static const char __pyx_k_step[] = "step";
2940 static const char __pyx_k_stop[] = "stop";
2941 static const char __pyx_k_test[] = "__test__";
2942 static const char __pyx_k_ASCII[] = "ASCII";
2943 static const char __pyx_k_class[] = "__class__";
2944 static const char __pyx_k_error[] = "error";
2945 static const char __pyx_k_flags[] = "flags";
2946 static const char __pyx_k_numpy[] = "numpy";
2947 static const char __pyx_k_range[] = "range";
2948 static const char __pyx_k_shape[] = "shape";
2949 static const char __pyx_k_start[] = "start";
2950 static const char __pyx_k_trace[] = "trace";
2951 static const char __pyx_k_encode[] = "encode";
2952 static const char __pyx_k_format[] = "format";
2953 static const char __pyx_k_import[] = "__import__";
2954 static const char __pyx_k_name_2[] = "__name__";
2955 static const char __pyx_k_pickle[] = "pickle";
2956 static const char __pyx_k_reduce[] = "__reduce__";
2957 static const char __pyx_k_struct[] = "struct";
2958 static const char __pyx_k_unpack[] = "unpack";
2959 static const char __pyx_k_update[] = "update";
2960 static const char __pyx_k_float32[] = "float32";
2961 static const char __pyx_k_float64[] = "float64";
2962 static const char __pyx_k_fortran[] = "fortran";
2963 static const char __pyx_k_memview[] = "memview";
2964 static const char __pyx_k_samples[] = "samples";
2965 static const char __pyx_k_Ellipsis[] = "Ellipsis";
2966 static const char __pyx_k_exponent[] = "exponent";
2967 static const char __pyx_k_float128[] = "float128";
2968 static const char __pyx_k_getstate[] = "__getstate__";
2969 static const char __pyx_k_isscalar[] = "isscalar";
2970 static const char __pyx_k_itemsize[] = "itemsize";
2971 static const char __pyx_k_pyx_type[] = "__pyx_type";
2972 static const char __pyx_k_setstate[] = "__setstate__";
2973 static const char __pyx_k_TypeError[] = "TypeError";
2974 static const char __pyx_k_converged[] = "converged";
2975 static const char __pyx_k_enumerate[] = "enumerate";
2976 static const char __pyx_k_pyx_state[] = "__pyx_state";
2977 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
2978 static const char __pyx_k_IndexError[] = "IndexError";
2979 static const char __pyx_k_ValueError[] = "ValueError";
2980 static const char __pyx_k_error_atol[] = "error_atol";
2981 static const char __pyx_k_error_rtol[] = "error_rtol";
2982 static const char __pyx_k_parameters[] = "parameters";
2983 static const char __pyx_k_pyx_result[] = "__pyx_result";
2984 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
2985 static const char __pyx_k_MemoryError[] = "MemoryError";
2986 static const char __pyx_k_PickleError[] = "PickleError";
2987 static const char __pyx_k_lanczos_tol[] = "lanczos_tol";
2988 static const char __pyx_k_num_threads[] = "num_threads";
2989 static const char __pyx_k_num_outliers[] = "num_outliers";
2990 static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
2991 static const char __pyx_k_stringsource[] = "stringsource";
2992 static const char __pyx_k_num_inquiries[] = "num_inquiries";
2993 static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
2994 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
2995 static const char __pyx_k_alg_wall_times[] = "alg_wall_times";
2996 static const char __pyx_k_data_type_name[] = "data_type_name";
2997 static const char __pyx_k_lanczos_degree[] = "lanczos_degree";
2998 static const char __pyx_k_View_MemoryView[] = "View.MemoryView";
2999 static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
3000 static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
3001 static const char __pyx_k_max_num_samples[] = "max_num_samples";
3002 static const char __pyx_k_min_num_samples[] = "min_num_samples";
3003 static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
3004 static const char __pyx_k_reorthogonalize[] = "reorthogonalize";
3005 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
3006 static const char __pyx_k_confidence_level[] = "confidence_level";
3007 static const char __pyx_k_num_samples_used[] = "num_samples_used";
3008 static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum";
3009 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
3010 static const char __pyx_k_py_matrix_function[] = "py_matrix_function";
3011 static const char __pyx_k_strided_and_direct[] = "<strided and direct>";
3012 static const char __pyx_k_pyc_trace_estimator[] = "pyc_trace_estimator";
3013 static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
3014 static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
3015 static const char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
3016 static const char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
3017 static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
3018 static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'";
3019 static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d.";
3020 static const char __pyx_k_processed_samples_indices[] = "processed_samples_indices";
3021 static const char __pyx_k_outlier_significance_level[] = "outlier_significance_level";
3022 static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
3023 static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
3024 static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
3025 static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
3026 static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
3027 static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to read-only memoryview";
3028 static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview";
3029 static const char __pyx_k_Data_type_should_be_float32_floa[] = "Data type should be \"float32\", \"float64\", or \"float128\".";
3030 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
3031 static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] = "Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))";
3032 static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
3033 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s";
3034 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
3035 static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
3036 static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)";
3037 static const char __pyx_k_imate__c_trace_estimator_py_c_tr[] = "imate/_c_trace_estimator/py_c_trace_estimator.pyx";
3038 static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
3039 static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
3040 static const char __pyx_k_imate__c_trace_estimator_py_c_tr_2[] = "imate._c_trace_estimator.py_c_trace_estimator";
3041 static PyObject *__pyx_n_s_ASCII;
3042 static PyObject *__pyx_n_s_Aop;
3043 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
3044 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
3045 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
3046 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
3047 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
3048 static PyObject *__pyx_kp_u_Data_type_should_be_float32_floa;
3049 static PyObject *__pyx_n_s_Ellipsis;
3050 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
3051 static PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0;
3052 static PyObject *__pyx_n_s_IndexError;
3053 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
3054 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
3055 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
3056 static PyObject *__pyx_n_s_MemoryError;
3057 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
3058 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
3059 static PyObject *__pyx_n_b_O;
3060 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
3061 static PyObject *__pyx_n_s_PickleError;
3062 static PyObject *__pyx_n_s_TypeError;
3063 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
3064 static PyObject *__pyx_n_s_ValueError;
3065 static PyObject *__pyx_n_s_View_MemoryView;
3066 static PyObject *__pyx_n_s_alg_wall_times;
3067 static PyObject *__pyx_n_s_allocate_buffer;
3068 static PyObject *__pyx_n_s_base;
3069 static PyObject *__pyx_n_s_c;
3070 static PyObject *__pyx_n_u_c;
3071 static PyObject *__pyx_n_s_class;
3072 static PyObject *__pyx_n_s_cline_in_traceback;
3073 static PyObject *__pyx_n_s_confidence_level;
3074 static PyObject *__pyx_kp_s_contiguous_and_direct;
3075 static PyObject *__pyx_kp_s_contiguous_and_indirect;
3076 static PyObject *__pyx_n_s_converged;
3077 static PyObject *__pyx_n_s_data_type_name;
3078 static PyObject *__pyx_n_s_dict;
3079 static PyObject *__pyx_n_s_dtype_is_object;
3080 static PyObject *__pyx_n_s_encode;
3081 static PyObject *__pyx_n_s_enumerate;
3082 static PyObject *__pyx_n_s_error;
3083 static PyObject *__pyx_n_s_error_atol;
3084 static PyObject *__pyx_n_s_error_rtol;
3085 static PyObject *__pyx_n_s_exponent;
3086 static PyObject *__pyx_n_s_flags;
3087 static PyObject *__pyx_n_b_float128;
3088 static PyObject *__pyx_n_b_float32;
3089 static PyObject *__pyx_n_b_float64;
3090 static PyObject *__pyx_n_s_format;
3091 static PyObject *__pyx_n_s_fortran;
3092 static PyObject *__pyx_n_u_fortran;
3093 static PyObject *__pyx_n_s_getstate;
3094 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
3095 static PyObject *__pyx_n_s_gram;
3096 static PyObject *__pyx_n_s_id;
3097 static PyObject *__pyx_kp_s_imate__c_trace_estimator_py_c_tr;
3098 static PyObject *__pyx_n_s_imate__c_trace_estimator_py_c_tr_2;
3099 static PyObject *__pyx_n_s_import;
3100 static PyObject *__pyx_n_s_isscalar;
3101 static PyObject *__pyx_n_s_itemsize;
3102 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
3103 static PyObject *__pyx_n_s_lanczos_degree;
3104 static PyObject *__pyx_n_s_lanczos_tol;
3105 static PyObject *__pyx_n_s_main;
3106 static PyObject *__pyx_n_s_max_num_samples;
3107 static PyObject *__pyx_n_s_memview;
3108 static PyObject *__pyx_n_s_min_num_samples;
3109 static PyObject *__pyx_n_s_mode;
3110 static PyObject *__pyx_n_s_name;
3111 static PyObject *__pyx_n_s_name_2;
3112 static PyObject *__pyx_n_s_ndim;
3113 static PyObject *__pyx_n_s_new;
3114 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
3115 static PyObject *__pyx_n_s_num_inquiries;
3116 static PyObject *__pyx_n_s_num_outliers;
3117 static PyObject *__pyx_n_s_num_samples_used;
3118 static PyObject *__pyx_n_s_num_threads;
3119 static PyObject *__pyx_n_s_numpy;
3120 static PyObject *__pyx_n_s_obj;
3121 static PyObject *__pyx_n_s_outlier_significance_level;
3122 static PyObject *__pyx_n_s_pack;
3123 static PyObject *__pyx_n_s_parameters;
3124 static PyObject *__pyx_n_s_pickle;
3125 static PyObject *__pyx_n_s_processed_samples_indices;
3126 static PyObject *__pyx_n_s_py_matrix_function;
3127 static PyObject *__pyx_n_s_pyc_trace_estimator;
3128 static PyObject *__pyx_n_s_pyx_PickleError;
3129 static PyObject *__pyx_n_s_pyx_checksum;
3130 static PyObject *__pyx_n_s_pyx_getbuffer;
3131 static PyObject *__pyx_n_s_pyx_result;
3132 static PyObject *__pyx_n_s_pyx_state;
3133 static PyObject *__pyx_n_s_pyx_type;
3134 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
3135 static PyObject *__pyx_n_s_pyx_vtable;
3136 static PyObject *__pyx_n_s_range;
3137 static PyObject *__pyx_n_s_reduce;
3138 static PyObject *__pyx_n_s_reduce_cython;
3139 static PyObject *__pyx_n_s_reduce_ex;
3140 static PyObject *__pyx_n_s_reorthogonalize;
3141 static PyObject *__pyx_n_s_samples;
3142 static PyObject *__pyx_n_s_seed;
3143 static PyObject *__pyx_n_s_setstate;
3144 static PyObject *__pyx_n_s_setstate_cython;
3145 static PyObject *__pyx_n_s_shape;
3146 static PyObject *__pyx_n_s_size;
3147 static PyObject *__pyx_n_s_start;
3148 static PyObject *__pyx_n_s_step;
3149 static PyObject *__pyx_n_s_stop;
3150 static PyObject *__pyx_kp_s_strided_and_direct;
3151 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
3152 static PyObject *__pyx_kp_s_strided_and_indirect;
3153 static PyObject *__pyx_kp_s_stringsource;
3154 static PyObject *__pyx_n_s_struct;
3155 static PyObject *__pyx_n_s_test;
3156 static PyObject *__pyx_n_s_trace;
3157 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
3158 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
3159 static PyObject *__pyx_n_s_unpack;
3160 static PyObject *__pyx_n_s_update;
3161 static PyObject *__pyx_pf_5imate_18_c_trace_estimator_20py_c_trace_estimator_pyc_trace_estimator(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_Aop, PyObject *__pyx_v_parameters, PyObject *__pyx_v_num_inquiries, struct __pyx_obj_5imate_9functions_12py_functions_pyFunction *__pyx_v_py_matrix_function, PyObject *__pyx_v_gram, PyObject *__pyx_v_exponent, PyObject *__pyx_v_reorthogonalize, PyObject *__pyx_v_seed, PyObject *__pyx_v_lanczos_degree, PyObject *__pyx_v_lanczos_tol, PyObject *__pyx_v_min_num_samples, PyObject *__pyx_v_max_num_samples, PyObject *__pyx_v_error_atol, PyObject *__pyx_v_error_rtol, PyObject *__pyx_v_confidence_level, PyObject *__pyx_v_outlier_significance_level, PyObject *__pyx_v_num_threads, PyObject *__pyx_v_data_type_name, PyObject *__pyx_v_trace, PyObject *__pyx_v_error, PyObject *__pyx_v_samples, PyObject *__pyx_v_processed_samples_indices, PyObject *__pyx_v_num_samples_used, PyObject *__pyx_v_num_outliers, PyObject *__pyx_v_converged, PyObject *__pyx_v_alg_wall_times); /* proto */
3162 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */
3163 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
3164 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
3165 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
3166 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */
3167 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
3168 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
3169 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
3170 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */
3171 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
3172 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
3173 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
3174 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
3175 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
3176 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */
3177 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3178 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
3179 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
3180 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
3181 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3182 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3183 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3184 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3185 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3186 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3187 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3188 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3189 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3190 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3191 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3192 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3193 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3194 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3195 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3196 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3197 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3198 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
3199 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
3200 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
3201 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
3202 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
3203 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
3204 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3205 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3206 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3207 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3208 static PyObject *__pyx_int_0;
3209 static PyObject *__pyx_int_1;
3210 static PyObject *__pyx_int_112105877;
3211 static PyObject *__pyx_int_136983863;
3212 static PyObject *__pyx_int_184977713;
3213 static PyObject *__pyx_int_neg_1;
3214 static PyObject *__pyx_codeobj_;
3215 static PyObject *__pyx_tuple__2;
3216 static PyObject *__pyx_tuple__3;
3217 static PyObject *__pyx_tuple__4;
3218 static PyObject *__pyx_tuple__5;
3219 static PyObject *__pyx_tuple__6;
3220 static PyObject *__pyx_tuple__7;
3221 static PyObject *__pyx_tuple__8;
3222 static PyObject *__pyx_tuple__9;
3223 static PyObject *__pyx_slice__17;
3224 static PyObject *__pyx_tuple__10;
3225 static PyObject *__pyx_tuple__11;
3226 static PyObject *__pyx_tuple__12;
3227 static PyObject *__pyx_tuple__13;
3228 static PyObject *__pyx_tuple__14;
3229 static PyObject *__pyx_tuple__15;
3230 static PyObject *__pyx_tuple__16;
3231 static PyObject *__pyx_tuple__18;
3232 static PyObject *__pyx_tuple__19;
3233 static PyObject *__pyx_tuple__20;
3234 static PyObject *__pyx_tuple__22;
3235 static PyObject *__pyx_tuple__23;
3236 static PyObject *__pyx_tuple__24;
3237 static PyObject *__pyx_tuple__25;
3238 static PyObject *__pyx_tuple__26;
3239 static PyObject *__pyx_tuple__27;
3240 static PyObject *__pyx_tuple__28;
3241 static PyObject *__pyx_tuple__29;
3242 static PyObject *__pyx_codeobj__21;
3243 /* Late includes */
3244 
3245 /* "imate/_c_trace_estimator/lapack_api.pxi":21
3246  * # ============
3247  *
3248  * cdef public void lapack_sstev(char* jobz, int* n, float* d, float* e, float* z, # <<<<<<<<<<<<<<
3249  * int* ldz, float* work, int* info) nogil:
3250  * """
3251  */
3252 
3253 void lapack_sstev(char *__pyx_v_jobz, int *__pyx_v_n, float *__pyx_v_d, float *__pyx_v_e, float *__pyx_v_z, int *__pyx_v_ldz, float *__pyx_v_work, int *__pyx_v_info) {
3254  __Pyx_TraceDeclarations
3255  int __pyx_lineno = 0;
3256  const char *__pyx_filename = NULL;
3257  int __pyx_clineno = 0;
3258  __Pyx_TraceCall("lapack_sstev", __pyx_f[1], 21, 1, __PYX_ERR(1, 21, __pyx_L1_error));
3259 
3260  /* "imate/_c_trace_estimator/lapack_api.pxi":34
3261  * """
3262  *
3263  * sstev(jobz, n, d, e, z, ldz, work, info) # <<<<<<<<<<<<<<
3264  *
3265  *
3266  */
3267  __Pyx_TraceLine(34,1,__PYX_ERR(1, 34, __pyx_L1_error))
3268  __pyx_f_5scipy_6linalg_13cython_lapack_sstev(__pyx_v_jobz, __pyx_v_n, __pyx_v_d, __pyx_v_e, __pyx_v_z, __pyx_v_ldz, __pyx_v_work, __pyx_v_info);
3269 
3270  /* "imate/_c_trace_estimator/lapack_api.pxi":21
3271  * # ============
3272  *
3273  * cdef public void lapack_sstev(char* jobz, int* n, float* d, float* e, float* z, # <<<<<<<<<<<<<<
3274  * int* ldz, float* work, int* info) nogil:
3275  * """
3276  */
3277 
3278  /* function exit code */
3279  goto __pyx_L0;
3280  __pyx_L1_error:;
3281  __Pyx_WriteUnraisable("imate._c_trace_estimator.py_c_trace_estimator.lapack_sstev", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
3282  __pyx_L0:;
3283  __Pyx_TraceReturn(Py_None, 1);
3284 }
3285 
3286 /* "imate/_c_trace_estimator/lapack_api.pxi":41
3287  * # ============
3288  *
3289  * cdef public void lapack_dstev(char* jobz, int* n, double* d, double* e, # <<<<<<<<<<<<<<
3290  * double* z, int* ldz, double* work,
3291  * int* info) nogil:
3292  */
3293 
3294 void lapack_dstev(char *__pyx_v_jobz, int *__pyx_v_n, double *__pyx_v_d, double *__pyx_v_e, double *__pyx_v_z, int *__pyx_v_ldz, double *__pyx_v_work, int *__pyx_v_info) {
3295  __Pyx_TraceDeclarations
3296  int __pyx_lineno = 0;
3297  const char *__pyx_filename = NULL;
3298  int __pyx_clineno = 0;
3299  __Pyx_TraceCall("lapack_dstev", __pyx_f[1], 41, 1, __PYX_ERR(1, 41, __pyx_L1_error));
3300 
3301  /* "imate/_c_trace_estimator/lapack_api.pxi":55
3302  * """
3303  *
3304  * dstev(jobz, n, d, e, z, ldz, work, info) # <<<<<<<<<<<<<<
3305  *
3306  *
3307  */
3308  __Pyx_TraceLine(55,1,__PYX_ERR(1, 55, __pyx_L1_error))
3309  __pyx_f_5scipy_6linalg_13cython_lapack_dstev(__pyx_v_jobz, __pyx_v_n, __pyx_v_d, __pyx_v_e, __pyx_v_z, __pyx_v_ldz, __pyx_v_work, __pyx_v_info);
3310 
3311  /* "imate/_c_trace_estimator/lapack_api.pxi":41
3312  * # ============
3313  *
3314  * cdef public void lapack_dstev(char* jobz, int* n, double* d, double* e, # <<<<<<<<<<<<<<
3315  * double* z, int* ldz, double* work,
3316  * int* info) nogil:
3317  */
3318 
3319  /* function exit code */
3320  goto __pyx_L0;
3321  __pyx_L1_error:;
3322  __Pyx_WriteUnraisable("imate._c_trace_estimator.py_c_trace_estimator.lapack_dstev", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
3323  __pyx_L0:;
3324  __Pyx_TraceReturn(Py_None, 1);
3325 }
3326 
3327 /* "imate/_c_trace_estimator/lapack_api.pxi":62
3328  * # =============
3329  *
3330  * cdef public void lapack_sbdsdc(char* uplo, char* compq, int* n, float* d, # <<<<<<<<<<<<<<
3331  * float *e, float* u, int* ldu, float* vt,
3332  * int* ldvt, float* q, int* iq, float* work,
3333  */
3334 
3335 void lapack_sbdsdc(char *__pyx_v_uplo, char *__pyx_v_compq, int *__pyx_v_n, float *__pyx_v_d, float *__pyx_v_e, float *__pyx_v_u, int *__pyx_v_ldu, float *__pyx_v_vt, int *__pyx_v_ldvt, float *__pyx_v_q, int *__pyx_v_iq, float *__pyx_v_work, int *__pyx_v_iwork, int *__pyx_v_info) {
3336  __Pyx_TraceDeclarations
3337  int __pyx_lineno = 0;
3338  const char *__pyx_filename = NULL;
3339  int __pyx_clineno = 0;
3340  __Pyx_TraceCall("lapack_sbdsdc", __pyx_f[1], 62, 1, __PYX_ERR(1, 62, __pyx_L1_error));
3341 
3342  /* "imate/_c_trace_estimator/lapack_api.pxi":77
3343  * """
3344  *
3345  * sbdsdc(uplo, compq, n, d, e, u, ldu, vt, ldvt, q, iq, work, iwork, info) # <<<<<<<<<<<<<<
3346  *
3347  *
3348  */
3349  __Pyx_TraceLine(77,1,__PYX_ERR(1, 77, __pyx_L1_error))
3350  __pyx_f_5scipy_6linalg_13cython_lapack_sbdsdc(__pyx_v_uplo, __pyx_v_compq, __pyx_v_n, __pyx_v_d, __pyx_v_e, __pyx_v_u, __pyx_v_ldu, __pyx_v_vt, __pyx_v_ldvt, __pyx_v_q, __pyx_v_iq, __pyx_v_work, __pyx_v_iwork, __pyx_v_info);
3351 
3352  /* "imate/_c_trace_estimator/lapack_api.pxi":62
3353  * # =============
3354  *
3355  * cdef public void lapack_sbdsdc(char* uplo, char* compq, int* n, float* d, # <<<<<<<<<<<<<<
3356  * float *e, float* u, int* ldu, float* vt,
3357  * int* ldvt, float* q, int* iq, float* work,
3358  */
3359 
3360  /* function exit code */
3361  goto __pyx_L0;
3362  __pyx_L1_error:;
3363  __Pyx_WriteUnraisable("imate._c_trace_estimator.py_c_trace_estimator.lapack_sbdsdc", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
3364  __pyx_L0:;
3365  __Pyx_TraceReturn(Py_None, 1);
3366 }
3367 
3368 /* "imate/_c_trace_estimator/lapack_api.pxi":84
3369  * # =============
3370  *
3371  * cdef public void lapack_dbdsdc(char* uplo, char* compq, int* n, double* d, # <<<<<<<<<<<<<<
3372  * double *e, double* u, int* ldu, double* vt,
3373  * int* ldvt, double* q, int* iq, double* work,
3374  */
3375 
3376 void lapack_dbdsdc(char *__pyx_v_uplo, char *__pyx_v_compq, int *__pyx_v_n, double *__pyx_v_d, double *__pyx_v_e, double *__pyx_v_u, int *__pyx_v_ldu, double *__pyx_v_vt, int *__pyx_v_ldvt, double *__pyx_v_q, int *__pyx_v_iq, double *__pyx_v_work, int *__pyx_v_iwork, int *__pyx_v_info) {
3377  __Pyx_TraceDeclarations
3378  int __pyx_lineno = 0;
3379  const char *__pyx_filename = NULL;
3380  int __pyx_clineno = 0;
3381  __Pyx_TraceCall("lapack_dbdsdc", __pyx_f[1], 84, 1, __PYX_ERR(1, 84, __pyx_L1_error));
3382 
3383  /* "imate/_c_trace_estimator/lapack_api.pxi":99
3384  * """
3385  *
3386  * dbdsdc(uplo, compq, n, d, e, u, ldu, vt, ldvt, q, iq, work, iwork, info) # <<<<<<<<<<<<<<
3387  */
3388  __Pyx_TraceLine(99,1,__PYX_ERR(1, 99, __pyx_L1_error))
3389  __pyx_f_5scipy_6linalg_13cython_lapack_dbdsdc(__pyx_v_uplo, __pyx_v_compq, __pyx_v_n, __pyx_v_d, __pyx_v_e, __pyx_v_u, __pyx_v_ldu, __pyx_v_vt, __pyx_v_ldvt, __pyx_v_q, __pyx_v_iq, __pyx_v_work, __pyx_v_iwork, __pyx_v_info);
3390 
3391  /* "imate/_c_trace_estimator/lapack_api.pxi":84
3392  * # =============
3393  *
3394  * cdef public void lapack_dbdsdc(char* uplo, char* compq, int* n, double* d, # <<<<<<<<<<<<<<
3395  * double *e, double* u, int* ldu, double* vt,
3396  * int* ldvt, double* q, int* iq, double* work,
3397  */
3398 
3399  /* function exit code */
3400  goto __pyx_L0;
3401  __pyx_L1_error:;
3402  __Pyx_WriteUnraisable("imate._c_trace_estimator.py_c_trace_estimator.lapack_dbdsdc", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
3403  __pyx_L0:;
3404  __Pyx_TraceReturn(Py_None, 1);
3405 }
3406 
3407 /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":39
3408  * # ===================
3409  *
3410  * cpdef FlagType pyc_trace_estimator( # <<<<<<<<<<<<<<
3411  * pycLinearOperator Aop,
3412  * parameters,
3413  */
3414 
3415 static PyObject *__pyx_pw_5imate_18_c_trace_estimator_20py_c_trace_estimator_1pyc_trace_estimator(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3416 static __pyx_t_5imate_12_definitions_5types_FlagType __pyx_f_5imate_18_c_trace_estimator_20py_c_trace_estimator_pyc_trace_estimator(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_Aop, PyObject *__pyx_v_parameters, PyObject *__pyx_v_num_inquiries, struct __pyx_obj_5imate_9functions_12py_functions_pyFunction *__pyx_v_py_matrix_function, PyObject *__pyx_v_gram, PyObject *__pyx_v_exponent, PyObject *__pyx_v_reorthogonalize, PyObject *__pyx_v_seed, PyObject *__pyx_v_lanczos_degree, PyObject *__pyx_v_lanczos_tol, PyObject *__pyx_v_min_num_samples, PyObject *__pyx_v_max_num_samples, PyObject *__pyx_v_error_atol, PyObject *__pyx_v_error_rtol, PyObject *__pyx_v_confidence_level, PyObject *__pyx_v_outlier_significance_level, PyObject *__pyx_v_num_threads, PyObject *__pyx_v_data_type_name, PyObject *__pyx_v_trace, PyObject *__pyx_v_error, PyObject *__pyx_v_samples, PyObject *__pyx_v_processed_samples_indices, PyObject *__pyx_v_num_samples_used, PyObject *__pyx_v_num_outliers, PyObject *__pyx_v_converged, PyObject *__pyx_v_alg_wall_times, CYTHON_UNUSED int __pyx_skip_dispatch) {
3417  __pyx_t_5imate_12_definitions_5types_FlagType __pyx_v_all_converged;
3418  float __pyx_v_alg_wall_time;
3419  __pyx_t_5imate_12_definitions_5types_FlagType __pyx_r;
3420  __Pyx_TraceDeclarations
3421  __Pyx_RefNannyDeclarations
3422  int __pyx_t_1;
3423  __pyx_t_5imate_12_definitions_5types_IndexType __pyx_t_2;
3424  PyObject *__pyx_t_3 = NULL;
3425  __pyx_t_5imate_12_definitions_5types_FlagType __pyx_t_4;
3426  float __pyx_t_5;
3427  __pyx_t_5imate_12_definitions_5types_FlagType __pyx_t_6;
3428  int64_t __pyx_t_7;
3429  __pyx_t_5imate_12_definitions_5types_IndexType __pyx_t_8;
3430  float __pyx_t_9;
3431  __pyx_t_5imate_12_definitions_5types_IndexType __pyx_t_10;
3432  __pyx_t_5imate_12_definitions_5types_IndexType __pyx_t_11;
3433  float __pyx_t_12;
3434  float __pyx_t_13;
3435  float __pyx_t_14;
3436  float __pyx_t_15;
3437  __pyx_t_5imate_12_definitions_5types_IndexType __pyx_t_16;
3438  __Pyx_memviewslice __pyx_t_17 = { 0, 0, { 0 }, { 0 }, { 0 } };
3439  __Pyx_memviewslice __pyx_t_18 = { 0, 0, { 0 }, { 0 }, { 0 } };
3440  __Pyx_memviewslice __pyx_t_19 = { 0, 0, { 0 }, { 0 }, { 0 } };
3441  __pyx_t_5imate_12_definitions_5types_MemoryViewIndexType __pyx_t_20 = { 0, 0, { 0 }, { 0 }, { 0 } };
3442  __pyx_t_5imate_12_definitions_5types_MemoryViewIndexType __pyx_t_21 = { 0, 0, { 0 }, { 0 }, { 0 } };
3443  __pyx_t_5imate_12_definitions_5types_MemoryViewIndexType __pyx_t_22 = { 0, 0, { 0 }, { 0 }, { 0 } };
3444  __pyx_t_5imate_12_definitions_5types_MemoryViewFlagType __pyx_t_23 = { 0, 0, { 0 }, { 0 }, { 0 } };
3445  __pyx_t_5imate_12_definitions_5types_FlagType __pyx_t_24;
3446  double __pyx_t_25;
3447  double __pyx_t_26;
3448  double __pyx_t_27;
3449  double __pyx_t_28;
3450  double __pyx_t_29;
3451  double __pyx_t_30;
3452  __Pyx_memviewslice __pyx_t_31 = { 0, 0, { 0 }, { 0 }, { 0 } };
3453  __Pyx_memviewslice __pyx_t_32 = { 0, 0, { 0 }, { 0 }, { 0 } };
3454  __Pyx_memviewslice __pyx_t_33 = { 0, 0, { 0 }, { 0 }, { 0 } };
3455  long double __pyx_t_34;
3456  long double __pyx_t_35;
3457  long double __pyx_t_36;
3458  long double __pyx_t_37;
3459  long double __pyx_t_38;
3460  long double __pyx_t_39;
3461  __Pyx_memviewslice __pyx_t_40 = { 0, 0, { 0 }, { 0 }, { 0 } };
3462  __Pyx_memviewslice __pyx_t_41 = { 0, 0, { 0 }, { 0 }, { 0 } };
3463  __Pyx_memviewslice __pyx_t_42 = { 0, 0, { 0 }, { 0 }, { 0 } };
3464  int __pyx_lineno = 0;
3465  const char *__pyx_filename = NULL;
3466  int __pyx_clineno = 0;
3467  __Pyx_TraceFrameInit(__pyx_codeobj_)
3468  __Pyx_RefNannySetupContext("pyc_trace_estimator", 0);
3469  __Pyx_TraceCall("pyc_trace_estimator", __pyx_f[0], 39, 0, __PYX_ERR(0, 39, __pyx_L1_error));
3470 
3471  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":69
3472  * """
3473  *
3474  * cdef FlagType all_converged = 0 # <<<<<<<<<<<<<<
3475  * cdef float alg_wall_time = 0.0
3476  *
3477  */
3478  __Pyx_TraceLine(69,0,__PYX_ERR(0, 69, __pyx_L1_error))
3479  __pyx_v_all_converged = 0;
3480 
3481  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":70
3482  *
3483  * cdef FlagType all_converged = 0
3484  * cdef float alg_wall_time = 0.0 # <<<<<<<<<<<<<<
3485  *
3486  * if data_type_name == b'float32':
3487  */
3488  __Pyx_TraceLine(70,0,__PYX_ERR(0, 70, __pyx_L1_error))
3489  __pyx_v_alg_wall_time = 0.0;
3490 
3491  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":72
3492  * cdef float alg_wall_time = 0.0
3493  *
3494  * if data_type_name == b'float32': # <<<<<<<<<<<<<<
3495  *
3496  * all_converged = _pyc_trace_estimator_float(
3497  */
3498  __Pyx_TraceLine(72,0,__PYX_ERR(0, 72, __pyx_L1_error))
3499  __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_v_data_type_name, __pyx_n_b_float32, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 72, __pyx_L1_error)
3500  if (__pyx_t_1) {
3501 
3502  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":77
3503  * Aop,
3504  * parameters,
3505  * num_inquiries, # <<<<<<<<<<<<<<
3506  * py_matrix_function,
3507  * int(gram),
3508  */
3509  __Pyx_TraceLine(77,0,__PYX_ERR(0, 77, __pyx_L1_error))
3510  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_num_inquiries); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 77, __pyx_L1_error)
3511 
3512  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":79
3513  * num_inquiries,
3514  * py_matrix_function,
3515  * int(gram), # <<<<<<<<<<<<<<
3516  * exponent,
3517  * reorthogonalize,
3518  */
3519  __Pyx_TraceLine(79,0,__PYX_ERR(0, 79, __pyx_L1_error))
3520  __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_v_gram); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 79, __pyx_L1_error)
3521  __Pyx_GOTREF(__pyx_t_3);
3522  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 79, __pyx_L1_error)
3523  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3524 
3525  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":80
3526  * py_matrix_function,
3527  * int(gram),
3528  * exponent, # <<<<<<<<<<<<<<
3529  * reorthogonalize,
3530  * seed,
3531  */
3532  __Pyx_TraceLine(80,0,__PYX_ERR(0, 80, __pyx_L1_error))
3533  __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_v_exponent); if (unlikely((__pyx_t_5 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 80, __pyx_L1_error)
3534 
3535  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":81
3536  * int(gram),
3537  * exponent,
3538  * reorthogonalize, # <<<<<<<<<<<<<<
3539  * seed,
3540  * lanczos_degree,
3541  */
3542  __Pyx_TraceLine(81,0,__PYX_ERR(0, 81, __pyx_L1_error))
3543  __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_reorthogonalize); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 81, __pyx_L1_error)
3544 
3545  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":82
3546  * exponent,
3547  * reorthogonalize,
3548  * seed, # <<<<<<<<<<<<<<
3549  * lanczos_degree,
3550  * lanczos_tol,
3551  */
3552  __Pyx_TraceLine(82,0,__PYX_ERR(0, 82, __pyx_L1_error))
3553  __pyx_t_7 = __Pyx_PyInt_As_int64_t(__pyx_v_seed); if (unlikely((__pyx_t_7 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 82, __pyx_L1_error)
3554 
3555  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":83
3556  * reorthogonalize,
3557  * seed,
3558  * lanczos_degree, # <<<<<<<<<<<<<<
3559  * lanczos_tol,
3560  * min_num_samples,
3561  */
3562  __Pyx_TraceLine(83,0,__PYX_ERR(0, 83, __pyx_L1_error))
3563  __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_lanczos_degree); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 83, __pyx_L1_error)
3564 
3565  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":84
3566  * seed,
3567  * lanczos_degree,
3568  * lanczos_tol, # <<<<<<<<<<<<<<
3569  * min_num_samples,
3570  * max_num_samples,
3571  */
3572  __Pyx_TraceLine(84,0,__PYX_ERR(0, 84, __pyx_L1_error))
3573  __pyx_t_9 = __pyx_PyFloat_AsFloat(__pyx_v_lanczos_tol); if (unlikely((__pyx_t_9 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 84, __pyx_L1_error)
3574 
3575  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":85
3576  * lanczos_degree,
3577  * lanczos_tol,
3578  * min_num_samples, # <<<<<<<<<<<<<<
3579  * max_num_samples,
3580  * error_atol,
3581  */
3582  __Pyx_TraceLine(85,0,__PYX_ERR(0, 85, __pyx_L1_error))
3583  __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_min_num_samples); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 85, __pyx_L1_error)
3584 
3585  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":86
3586  * lanczos_tol,
3587  * min_num_samples,
3588  * max_num_samples, # <<<<<<<<<<<<<<
3589  * error_atol,
3590  * error_rtol,
3591  */
3592  __Pyx_TraceLine(86,0,__PYX_ERR(0, 86, __pyx_L1_error))
3593  __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_v_max_num_samples); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 86, __pyx_L1_error)
3594 
3595  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":87
3596  * min_num_samples,
3597  * max_num_samples,
3598  * error_atol, # <<<<<<<<<<<<<<
3599  * error_rtol,
3600  * confidence_level,
3601  */
3602  __Pyx_TraceLine(87,0,__PYX_ERR(0, 87, __pyx_L1_error))
3603  __pyx_t_12 = __pyx_PyFloat_AsFloat(__pyx_v_error_atol); if (unlikely((__pyx_t_12 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 87, __pyx_L1_error)
3604 
3605  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":88
3606  * max_num_samples,
3607  * error_atol,
3608  * error_rtol, # <<<<<<<<<<<<<<
3609  * confidence_level,
3610  * outlier_significance_level,
3611  */
3612  __Pyx_TraceLine(88,0,__PYX_ERR(0, 88, __pyx_L1_error))
3613  __pyx_t_13 = __pyx_PyFloat_AsFloat(__pyx_v_error_rtol); if (unlikely((__pyx_t_13 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 88, __pyx_L1_error)
3614 
3615  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":89
3616  * error_atol,
3617  * error_rtol,
3618  * confidence_level, # <<<<<<<<<<<<<<
3619  * outlier_significance_level,
3620  * num_threads,
3621  */
3622  __Pyx_TraceLine(89,0,__PYX_ERR(0, 89, __pyx_L1_error))
3623  __pyx_t_14 = __pyx_PyFloat_AsFloat(__pyx_v_confidence_level); if (unlikely((__pyx_t_14 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 89, __pyx_L1_error)
3624 
3625  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":90
3626  * error_rtol,
3627  * confidence_level,
3628  * outlier_significance_level, # <<<<<<<<<<<<<<
3629  * num_threads,
3630  * trace,
3631  */
3632  __Pyx_TraceLine(90,0,__PYX_ERR(0, 90, __pyx_L1_error))
3633  __pyx_t_15 = __pyx_PyFloat_AsFloat(__pyx_v_outlier_significance_level); if (unlikely((__pyx_t_15 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 90, __pyx_L1_error)
3634 
3635  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":91
3636  * confidence_level,
3637  * outlier_significance_level,
3638  * num_threads, # <<<<<<<<<<<<<<
3639  * trace,
3640  * error,
3641  */
3642  __Pyx_TraceLine(91,0,__PYX_ERR(0, 91, __pyx_L1_error))
3643  __pyx_t_16 = __Pyx_PyInt_As_int(__pyx_v_num_threads); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 91, __pyx_L1_error)
3644 
3645  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":92
3646  * outlier_significance_level,
3647  * num_threads,
3648  * trace, # <<<<<<<<<<<<<<
3649  * error,
3650  * samples,
3651  */
3652  __Pyx_TraceLine(92,0,__PYX_ERR(0, 92, __pyx_L1_error))
3653  __pyx_t_17 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_trace, PyBUF_WRITABLE); if (unlikely(!__pyx_t_17.memview)) __PYX_ERR(0, 92, __pyx_L1_error)
3654 
3655  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":93
3656  * num_threads,
3657  * trace,
3658  * error, # <<<<<<<<<<<<<<
3659  * samples,
3660  * processed_samples_indices,
3661  */
3662  __Pyx_TraceLine(93,0,__PYX_ERR(0, 93, __pyx_L1_error))
3663  __pyx_t_18 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_error, PyBUF_WRITABLE); if (unlikely(!__pyx_t_18.memview)) __PYX_ERR(0, 93, __pyx_L1_error)
3664 
3665  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":94
3666  * trace,
3667  * error,
3668  * samples, # <<<<<<<<<<<<<<
3669  * processed_samples_indices,
3670  * num_samples_used,
3671  */
3672  __Pyx_TraceLine(94,0,__PYX_ERR(0, 94, __pyx_L1_error))
3673  __pyx_t_19 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_float(__pyx_v_samples, PyBUF_WRITABLE); if (unlikely(!__pyx_t_19.memview)) __PYX_ERR(0, 94, __pyx_L1_error)
3674 
3675  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":95
3676  * error,
3677  * samples,
3678  * processed_samples_indices, # <<<<<<<<<<<<<<
3679  * num_samples_used,
3680  * num_outliers,
3681  */
3682  __Pyx_TraceLine(95,0,__PYX_ERR(0, 95, __pyx_L1_error))
3683  __pyx_t_20 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_processed_samples_indices, PyBUF_WRITABLE); if (unlikely(!__pyx_t_20.memview)) __PYX_ERR(0, 95, __pyx_L1_error)
3684 
3685  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":96
3686  * samples,
3687  * processed_samples_indices,
3688  * num_samples_used, # <<<<<<<<<<<<<<
3689  * num_outliers,
3690  * converged,
3691  */
3692  __Pyx_TraceLine(96,0,__PYX_ERR(0, 96, __pyx_L1_error))
3693  __pyx_t_21 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_num_samples_used, PyBUF_WRITABLE); if (unlikely(!__pyx_t_21.memview)) __PYX_ERR(0, 96, __pyx_L1_error)
3694 
3695  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":97
3696  * processed_samples_indices,
3697  * num_samples_used,
3698  * num_outliers, # <<<<<<<<<<<<<<
3699  * converged,
3700  * alg_wall_time)
3701  */
3702  __Pyx_TraceLine(97,0,__PYX_ERR(0, 97, __pyx_L1_error))
3703  __pyx_t_22 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_num_outliers, PyBUF_WRITABLE); if (unlikely(!__pyx_t_22.memview)) __PYX_ERR(0, 97, __pyx_L1_error)
3704 
3705  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":98
3706  * num_samples_used,
3707  * num_outliers,
3708  * converged, # <<<<<<<<<<<<<<
3709  * alg_wall_time)
3710  *
3711  */
3712  __Pyx_TraceLine(98,0,__PYX_ERR(0, 98, __pyx_L1_error))
3713  __pyx_t_23 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_converged, PyBUF_WRITABLE); if (unlikely(!__pyx_t_23.memview)) __PYX_ERR(0, 98, __pyx_L1_error)
3714 
3715  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":74
3716  * if data_type_name == b'float32':
3717  *
3718  * all_converged = _pyc_trace_estimator_float( # <<<<<<<<<<<<<<
3719  * Aop,
3720  * parameters,
3721  */
3722  __Pyx_TraceLine(74,0,__PYX_ERR(0, 74, __pyx_L1_error))
3723  __pyx_t_24 = __pyx_f_5imate_18_c_trace_estimator_20py_c_trace_estimator__pyc_trace_estimator_float(__pyx_v_Aop, __pyx_v_parameters, __pyx_t_2, __pyx_v_py_matrix_function, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10, __pyx_t_11, __pyx_t_12, __pyx_t_13, __pyx_t_14, __pyx_t_15, __pyx_t_16, __pyx_t_17, __pyx_t_18, __pyx_t_19, __pyx_t_20, __pyx_t_21, __pyx_t_22, __pyx_t_23, __pyx_v_alg_wall_time); if (unlikely(__pyx_t_24 == ((__pyx_t_5imate_12_definitions_5types_FlagType)-1) && PyErr_Occurred())) __PYX_ERR(0, 74, __pyx_L1_error)
3724  __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);
3725  __pyx_t_17.memview = NULL;
3726  __pyx_t_17.data = NULL;
3727  __PYX_XDEC_MEMVIEW(&__pyx_t_18, 1);
3728  __pyx_t_18.memview = NULL;
3729  __pyx_t_18.data = NULL;
3730  __PYX_XDEC_MEMVIEW(&__pyx_t_19, 1);
3731  __pyx_t_19.memview = NULL;
3732  __pyx_t_19.data = NULL;
3733  __PYX_XDEC_MEMVIEW(&__pyx_t_20, 1);
3734  __pyx_t_20.memview = NULL;
3735  __pyx_t_20.data = NULL;
3736  __PYX_XDEC_MEMVIEW(&__pyx_t_21, 1);
3737  __pyx_t_21.memview = NULL;
3738  __pyx_t_21.data = NULL;
3739  __PYX_XDEC_MEMVIEW(&__pyx_t_22, 1);
3740  __pyx_t_22.memview = NULL;
3741  __pyx_t_22.data = NULL;
3742  __PYX_XDEC_MEMVIEW(&__pyx_t_23, 1);
3743  __pyx_t_23.memview = NULL;
3744  __pyx_t_23.data = NULL;
3745  __pyx_v_all_converged = __pyx_t_24;
3746 
3747  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":72
3748  * cdef float alg_wall_time = 0.0
3749  *
3750  * if data_type_name == b'float32': # <<<<<<<<<<<<<<
3751  *
3752  * all_converged = _pyc_trace_estimator_float(
3753  */
3754  goto __pyx_L3;
3755  }
3756 
3757  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":101
3758  * alg_wall_time)
3759  *
3760  * elif data_type_name == b'float64': # <<<<<<<<<<<<<<
3761  *
3762  * all_converged = _pyc_trace_estimator_double(
3763  */
3764  __Pyx_TraceLine(101,0,__PYX_ERR(0, 101, __pyx_L1_error))
3765  __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_v_data_type_name, __pyx_n_b_float64, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 101, __pyx_L1_error)
3766  if (__pyx_t_1) {
3767 
3768  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":106
3769  * Aop,
3770  * parameters,
3771  * num_inquiries, # <<<<<<<<<<<<<<
3772  * py_matrix_function,
3773  * int(gram),
3774  */
3775  __Pyx_TraceLine(106,0,__PYX_ERR(0, 106, __pyx_L1_error))
3776  __pyx_t_16 = __Pyx_PyInt_As_int(__pyx_v_num_inquiries); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 106, __pyx_L1_error)
3777 
3778  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":108
3779  * num_inquiries,
3780  * py_matrix_function,
3781  * int(gram), # <<<<<<<<<<<<<<
3782  * exponent,
3783  * reorthogonalize,
3784  */
3785  __Pyx_TraceLine(108,0,__PYX_ERR(0, 108, __pyx_L1_error))
3786  __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_v_gram); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 108, __pyx_L1_error)
3787  __Pyx_GOTREF(__pyx_t_3);
3788  __pyx_t_24 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_24 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 108, __pyx_L1_error)
3789  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3790 
3791  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":109
3792  * py_matrix_function,
3793  * int(gram),
3794  * exponent, # <<<<<<<<<<<<<<
3795  * reorthogonalize,
3796  * seed,
3797  */
3798  __Pyx_TraceLine(109,0,__PYX_ERR(0, 109, __pyx_L1_error))
3799  __pyx_t_25 = __pyx_PyFloat_AsDouble(__pyx_v_exponent); if (unlikely((__pyx_t_25 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 109, __pyx_L1_error)
3800 
3801  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":110
3802  * int(gram),
3803  * exponent,
3804  * reorthogonalize, # <<<<<<<<<<<<<<
3805  * seed,
3806  * lanczos_degree,
3807  */
3808  __Pyx_TraceLine(110,0,__PYX_ERR(0, 110, __pyx_L1_error))
3809  __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_reorthogonalize); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 110, __pyx_L1_error)
3810 
3811  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":111
3812  * exponent,
3813  * reorthogonalize,
3814  * seed, # <<<<<<<<<<<<<<
3815  * lanczos_degree,
3816  * lanczos_tol,
3817  */
3818  __Pyx_TraceLine(111,0,__PYX_ERR(0, 111, __pyx_L1_error))
3819  __pyx_t_7 = __Pyx_PyInt_As_int64_t(__pyx_v_seed); if (unlikely((__pyx_t_7 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 111, __pyx_L1_error)
3820 
3821  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":112
3822  * reorthogonalize,
3823  * seed,
3824  * lanczos_degree, # <<<<<<<<<<<<<<
3825  * lanczos_tol,
3826  * min_num_samples,
3827  */
3828  __Pyx_TraceLine(112,0,__PYX_ERR(0, 112, __pyx_L1_error))
3829  __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_v_lanczos_degree); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 112, __pyx_L1_error)
3830 
3831  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":113
3832  * seed,
3833  * lanczos_degree,
3834  * lanczos_tol, # <<<<<<<<<<<<<<
3835  * min_num_samples,
3836  * max_num_samples,
3837  */
3838  __Pyx_TraceLine(113,0,__PYX_ERR(0, 113, __pyx_L1_error))
3839  __pyx_t_26 = __pyx_PyFloat_AsDouble(__pyx_v_lanczos_tol); if (unlikely((__pyx_t_26 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 113, __pyx_L1_error)
3840 
3841  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":114
3842  * lanczos_degree,
3843  * lanczos_tol,
3844  * min_num_samples, # <<<<<<<<<<<<<<
3845  * max_num_samples,
3846  * error_atol,
3847  */
3848  __Pyx_TraceLine(114,0,__PYX_ERR(0, 114, __pyx_L1_error))
3849  __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_min_num_samples); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 114, __pyx_L1_error)
3850 
3851  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":115
3852  * lanczos_tol,
3853  * min_num_samples,
3854  * max_num_samples, # <<<<<<<<<<<<<<
3855  * error_atol,
3856  * error_rtol,
3857  */
3858  __Pyx_TraceLine(115,0,__PYX_ERR(0, 115, __pyx_L1_error))
3859  __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_max_num_samples); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 115, __pyx_L1_error)
3860 
3861  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":116
3862  * min_num_samples,
3863  * max_num_samples,
3864  * error_atol, # <<<<<<<<<<<<<<
3865  * error_rtol,
3866  * confidence_level,
3867  */
3868  __Pyx_TraceLine(116,0,__PYX_ERR(0, 116, __pyx_L1_error))
3869  __pyx_t_27 = __pyx_PyFloat_AsDouble(__pyx_v_error_atol); if (unlikely((__pyx_t_27 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 116, __pyx_L1_error)
3870 
3871  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":117
3872  * max_num_samples,
3873  * error_atol,
3874  * error_rtol, # <<<<<<<<<<<<<<
3875  * confidence_level,
3876  * outlier_significance_level,
3877  */
3878  __Pyx_TraceLine(117,0,__PYX_ERR(0, 117, __pyx_L1_error))
3879  __pyx_t_28 = __pyx_PyFloat_AsDouble(__pyx_v_error_rtol); if (unlikely((__pyx_t_28 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 117, __pyx_L1_error)
3880 
3881  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":118
3882  * error_atol,
3883  * error_rtol,
3884  * confidence_level, # <<<<<<<<<<<<<<
3885  * outlier_significance_level,
3886  * num_threads,
3887  */
3888  __Pyx_TraceLine(118,0,__PYX_ERR(0, 118, __pyx_L1_error))
3889  __pyx_t_29 = __pyx_PyFloat_AsDouble(__pyx_v_confidence_level); if (unlikely((__pyx_t_29 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 118, __pyx_L1_error)
3890 
3891  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":119
3892  * error_rtol,
3893  * confidence_level,
3894  * outlier_significance_level, # <<<<<<<<<<<<<<
3895  * num_threads,
3896  * trace,
3897  */
3898  __Pyx_TraceLine(119,0,__PYX_ERR(0, 119, __pyx_L1_error))
3899  __pyx_t_30 = __pyx_PyFloat_AsDouble(__pyx_v_outlier_significance_level); if (unlikely((__pyx_t_30 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 119, __pyx_L1_error)
3900 
3901  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":120
3902  * confidence_level,
3903  * outlier_significance_level,
3904  * num_threads, # <<<<<<<<<<<<<<
3905  * trace,
3906  * error,
3907  */
3908  __Pyx_TraceLine(120,0,__PYX_ERR(0, 120, __pyx_L1_error))
3909  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_num_threads); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 120, __pyx_L1_error)
3910 
3911  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":121
3912  * outlier_significance_level,
3913  * num_threads,
3914  * trace, # <<<<<<<<<<<<<<
3915  * error,
3916  * samples,
3917  */
3918  __Pyx_TraceLine(121,0,__PYX_ERR(0, 121, __pyx_L1_error))
3919  __pyx_t_31 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_trace, PyBUF_WRITABLE); if (unlikely(!__pyx_t_31.memview)) __PYX_ERR(0, 121, __pyx_L1_error)
3920 
3921  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":122
3922  * num_threads,
3923  * trace,
3924  * error, # <<<<<<<<<<<<<<
3925  * samples,
3926  * processed_samples_indices,
3927  */
3928  __Pyx_TraceLine(122,0,__PYX_ERR(0, 122, __pyx_L1_error))
3929  __pyx_t_32 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_error, PyBUF_WRITABLE); if (unlikely(!__pyx_t_32.memview)) __PYX_ERR(0, 122, __pyx_L1_error)
3930 
3931  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":123
3932  * trace,
3933  * error,
3934  * samples, # <<<<<<<<<<<<<<
3935  * processed_samples_indices,
3936  * num_samples_used,
3937  */
3938  __Pyx_TraceLine(123,0,__PYX_ERR(0, 123, __pyx_L1_error))
3939  __pyx_t_33 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_v_samples, PyBUF_WRITABLE); if (unlikely(!__pyx_t_33.memview)) __PYX_ERR(0, 123, __pyx_L1_error)
3940 
3941  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":124
3942  * error,
3943  * samples,
3944  * processed_samples_indices, # <<<<<<<<<<<<<<
3945  * num_samples_used,
3946  * num_outliers,
3947  */
3948  __Pyx_TraceLine(124,0,__PYX_ERR(0, 124, __pyx_L1_error))
3949  __pyx_t_22 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_processed_samples_indices, PyBUF_WRITABLE); if (unlikely(!__pyx_t_22.memview)) __PYX_ERR(0, 124, __pyx_L1_error)
3950 
3951  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":125
3952  * samples,
3953  * processed_samples_indices,
3954  * num_samples_used, # <<<<<<<<<<<<<<
3955  * num_outliers,
3956  * converged,
3957  */
3958  __Pyx_TraceLine(125,0,__PYX_ERR(0, 125, __pyx_L1_error))
3959  __pyx_t_21 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_num_samples_used, PyBUF_WRITABLE); if (unlikely(!__pyx_t_21.memview)) __PYX_ERR(0, 125, __pyx_L1_error)
3960 
3961  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":126
3962  * processed_samples_indices,
3963  * num_samples_used,
3964  * num_outliers, # <<<<<<<<<<<<<<
3965  * converged,
3966  * alg_wall_time)
3967  */
3968  __Pyx_TraceLine(126,0,__PYX_ERR(0, 126, __pyx_L1_error))
3969  __pyx_t_20 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_num_outliers, PyBUF_WRITABLE); if (unlikely(!__pyx_t_20.memview)) __PYX_ERR(0, 126, __pyx_L1_error)
3970 
3971  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":127
3972  * num_samples_used,
3973  * num_outliers,
3974  * converged, # <<<<<<<<<<<<<<
3975  * alg_wall_time)
3976  *
3977  */
3978  __Pyx_TraceLine(127,0,__PYX_ERR(0, 127, __pyx_L1_error))
3979  __pyx_t_23 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_converged, PyBUF_WRITABLE); if (unlikely(!__pyx_t_23.memview)) __PYX_ERR(0, 127, __pyx_L1_error)
3980 
3981  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":103
3982  * elif data_type_name == b'float64':
3983  *
3984  * all_converged = _pyc_trace_estimator_double( # <<<<<<<<<<<<<<
3985  * Aop,
3986  * parameters,
3987  */
3988  __Pyx_TraceLine(103,0,__PYX_ERR(0, 103, __pyx_L1_error))
3989  __pyx_t_4 = __pyx_f_5imate_18_c_trace_estimator_20py_c_trace_estimator__pyc_trace_estimator_double(__pyx_v_Aop, __pyx_v_parameters, __pyx_t_16, __pyx_v_py_matrix_function, __pyx_t_24, __pyx_t_25, __pyx_t_6, __pyx_t_7, __pyx_t_11, __pyx_t_26, __pyx_t_10, __pyx_t_8, __pyx_t_27, __pyx_t_28, __pyx_t_29, __pyx_t_30, __pyx_t_2, __pyx_t_31, __pyx_t_32, __pyx_t_33, __pyx_t_22, __pyx_t_21, __pyx_t_20, __pyx_t_23, __pyx_v_alg_wall_time); if (unlikely(__pyx_t_4 == ((__pyx_t_5imate_12_definitions_5types_FlagType)-1) && PyErr_Occurred())) __PYX_ERR(0, 103, __pyx_L1_error)
3990  __PYX_XDEC_MEMVIEW(&__pyx_t_31, 1);
3991  __pyx_t_31.memview = NULL;
3992  __pyx_t_31.data = NULL;
3993  __PYX_XDEC_MEMVIEW(&__pyx_t_32, 1);
3994  __pyx_t_32.memview = NULL;
3995  __pyx_t_32.data = NULL;
3996  __PYX_XDEC_MEMVIEW(&__pyx_t_33, 1);
3997  __pyx_t_33.memview = NULL;
3998  __pyx_t_33.data = NULL;
3999  __PYX_XDEC_MEMVIEW(&__pyx_t_22, 1);
4000  __pyx_t_22.memview = NULL;
4001  __pyx_t_22.data = NULL;
4002  __PYX_XDEC_MEMVIEW(&__pyx_t_21, 1);
4003  __pyx_t_21.memview = NULL;
4004  __pyx_t_21.data = NULL;
4005  __PYX_XDEC_MEMVIEW(&__pyx_t_20, 1);
4006  __pyx_t_20.memview = NULL;
4007  __pyx_t_20.data = NULL;
4008  __PYX_XDEC_MEMVIEW(&__pyx_t_23, 1);
4009  __pyx_t_23.memview = NULL;
4010  __pyx_t_23.data = NULL;
4011  __pyx_v_all_converged = __pyx_t_4;
4012 
4013  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":101
4014  * alg_wall_time)
4015  *
4016  * elif data_type_name == b'float64': # <<<<<<<<<<<<<<
4017  *
4018  * all_converged = _pyc_trace_estimator_double(
4019  */
4020  goto __pyx_L3;
4021  }
4022 
4023  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":130
4024  * alg_wall_time)
4025  *
4026  * elif data_type_name == b'float128': # <<<<<<<<<<<<<<
4027  *
4028  * all_converged = _pyc_trace_estimator_long_double(
4029  */
4030  __Pyx_TraceLine(130,0,__PYX_ERR(0, 130, __pyx_L1_error))
4031  __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_v_data_type_name, __pyx_n_b_float128, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 130, __pyx_L1_error)
4032  if (likely(__pyx_t_1)) {
4033 
4034  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":135
4035  * Aop,
4036  * parameters,
4037  * num_inquiries, # <<<<<<<<<<<<<<
4038  * py_matrix_function,
4039  * int(gram),
4040  */
4041  __Pyx_TraceLine(135,0,__PYX_ERR(0, 135, __pyx_L1_error))
4042  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_num_inquiries); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 135, __pyx_L1_error)
4043 
4044  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":137
4045  * num_inquiries,
4046  * py_matrix_function,
4047  * int(gram), # <<<<<<<<<<<<<<
4048  * exponent,
4049  * reorthogonalize,
4050  */
4051  __Pyx_TraceLine(137,0,__PYX_ERR(0, 137, __pyx_L1_error))
4052  __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_v_gram); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 137, __pyx_L1_error)
4053  __Pyx_GOTREF(__pyx_t_3);
4054  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 137, __pyx_L1_error)
4055  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4056 
4057  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":138
4058  * py_matrix_function,
4059  * int(gram),
4060  * exponent, # <<<<<<<<<<<<<<
4061  * reorthogonalize,
4062  * seed,
4063  */
4064  __Pyx_TraceLine(138,0,__PYX_ERR(0, 138, __pyx_L1_error))
4065  __pyx_t_34 = __pyx_PyFloat_AsDouble(__pyx_v_exponent); if (unlikely((__pyx_t_34 == (long double)-1) && PyErr_Occurred())) __PYX_ERR(0, 138, __pyx_L1_error)
4066 
4067  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":139
4068  * int(gram),
4069  * exponent,
4070  * reorthogonalize, # <<<<<<<<<<<<<<
4071  * seed,
4072  * lanczos_degree,
4073  */
4074  __Pyx_TraceLine(139,0,__PYX_ERR(0, 139, __pyx_L1_error))
4075  __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_reorthogonalize); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 139, __pyx_L1_error)
4076 
4077  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":140
4078  * exponent,
4079  * reorthogonalize,
4080  * seed, # <<<<<<<<<<<<<<
4081  * lanczos_degree,
4082  * lanczos_tol,
4083  */
4084  __Pyx_TraceLine(140,0,__PYX_ERR(0, 140, __pyx_L1_error))
4085  __pyx_t_7 = __Pyx_PyInt_As_int64_t(__pyx_v_seed); if (unlikely((__pyx_t_7 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 140, __pyx_L1_error)
4086 
4087  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":141
4088  * reorthogonalize,
4089  * seed,
4090  * lanczos_degree, # <<<<<<<<<<<<<<
4091  * lanczos_tol,
4092  * min_num_samples,
4093  */
4094  __Pyx_TraceLine(141,0,__PYX_ERR(0, 141, __pyx_L1_error))
4095  __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_lanczos_degree); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 141, __pyx_L1_error)
4096 
4097  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":142
4098  * seed,
4099  * lanczos_degree,
4100  * lanczos_tol, # <<<<<<<<<<<<<<
4101  * min_num_samples,
4102  * max_num_samples,
4103  */
4104  __Pyx_TraceLine(142,0,__PYX_ERR(0, 142, __pyx_L1_error))
4105  __pyx_t_35 = __pyx_PyFloat_AsDouble(__pyx_v_lanczos_tol); if (unlikely((__pyx_t_35 == (long double)-1) && PyErr_Occurred())) __PYX_ERR(0, 142, __pyx_L1_error)
4106 
4107  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":143
4108  * lanczos_degree,
4109  * lanczos_tol,
4110  * min_num_samples, # <<<<<<<<<<<<<<
4111  * max_num_samples,
4112  * error_atol,
4113  */
4114  __Pyx_TraceLine(143,0,__PYX_ERR(0, 143, __pyx_L1_error))
4115  __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_min_num_samples); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 143, __pyx_L1_error)
4116 
4117  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":144
4118  * lanczos_tol,
4119  * min_num_samples,
4120  * max_num_samples, # <<<<<<<<<<<<<<
4121  * error_atol,
4122  * error_rtol,
4123  */
4124  __Pyx_TraceLine(144,0,__PYX_ERR(0, 144, __pyx_L1_error))
4125  __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_v_max_num_samples); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 144, __pyx_L1_error)
4126 
4127  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":145
4128  * min_num_samples,
4129  * max_num_samples,
4130  * error_atol, # <<<<<<<<<<<<<<
4131  * error_rtol,
4132  * confidence_level,
4133  */
4134  __Pyx_TraceLine(145,0,__PYX_ERR(0, 145, __pyx_L1_error))
4135  __pyx_t_36 = __pyx_PyFloat_AsDouble(__pyx_v_error_atol); if (unlikely((__pyx_t_36 == (long double)-1) && PyErr_Occurred())) __PYX_ERR(0, 145, __pyx_L1_error)
4136 
4137  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":146
4138  * max_num_samples,
4139  * error_atol,
4140  * error_rtol, # <<<<<<<<<<<<<<
4141  * confidence_level,
4142  * outlier_significance_level,
4143  */
4144  __Pyx_TraceLine(146,0,__PYX_ERR(0, 146, __pyx_L1_error))
4145  __pyx_t_37 = __pyx_PyFloat_AsDouble(__pyx_v_error_rtol); if (unlikely((__pyx_t_37 == (long double)-1) && PyErr_Occurred())) __PYX_ERR(0, 146, __pyx_L1_error)
4146 
4147  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":147
4148  * error_atol,
4149  * error_rtol,
4150  * confidence_level, # <<<<<<<<<<<<<<
4151  * outlier_significance_level,
4152  * num_threads,
4153  */
4154  __Pyx_TraceLine(147,0,__PYX_ERR(0, 147, __pyx_L1_error))
4155  __pyx_t_38 = __pyx_PyFloat_AsDouble(__pyx_v_confidence_level); if (unlikely((__pyx_t_38 == (long double)-1) && PyErr_Occurred())) __PYX_ERR(0, 147, __pyx_L1_error)
4156 
4157  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":148
4158  * error_rtol,
4159  * confidence_level,
4160  * outlier_significance_level, # <<<<<<<<<<<<<<
4161  * num_threads,
4162  * trace,
4163  */
4164  __Pyx_TraceLine(148,0,__PYX_ERR(0, 148, __pyx_L1_error))
4165  __pyx_t_39 = __pyx_PyFloat_AsDouble(__pyx_v_outlier_significance_level); if (unlikely((__pyx_t_39 == (long double)-1) && PyErr_Occurred())) __PYX_ERR(0, 148, __pyx_L1_error)
4166 
4167  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":149
4168  * confidence_level,
4169  * outlier_significance_level,
4170  * num_threads, # <<<<<<<<<<<<<<
4171  * trace,
4172  * error,
4173  */
4174  __Pyx_TraceLine(149,0,__PYX_ERR(0, 149, __pyx_L1_error))
4175  __pyx_t_16 = __Pyx_PyInt_As_int(__pyx_v_num_threads); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 149, __pyx_L1_error)
4176 
4177  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":150
4178  * outlier_significance_level,
4179  * num_threads,
4180  * trace, # <<<<<<<<<<<<<<
4181  * error,
4182  * samples,
4183  */
4184  __Pyx_TraceLine(150,0,__PYX_ERR(0, 150, __pyx_L1_error))
4185  __pyx_t_40 = __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(__pyx_v_trace, PyBUF_WRITABLE); if (unlikely(!__pyx_t_40.memview)) __PYX_ERR(0, 150, __pyx_L1_error)
4186 
4187  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":151
4188  * num_threads,
4189  * trace,
4190  * error, # <<<<<<<<<<<<<<
4191  * samples,
4192  * processed_samples_indices,
4193  */
4194  __Pyx_TraceLine(151,0,__PYX_ERR(0, 151, __pyx_L1_error))
4195  __pyx_t_41 = __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(__pyx_v_error, PyBUF_WRITABLE); if (unlikely(!__pyx_t_41.memview)) __PYX_ERR(0, 151, __pyx_L1_error)
4196 
4197  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":152
4198  * trace,
4199  * error,
4200  * samples, # <<<<<<<<<<<<<<
4201  * processed_samples_indices,
4202  * num_samples_used,
4203  */
4204  __Pyx_TraceLine(152,0,__PYX_ERR(0, 152, __pyx_L1_error))
4205  __pyx_t_42 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_long__double(__pyx_v_samples, PyBUF_WRITABLE); if (unlikely(!__pyx_t_42.memview)) __PYX_ERR(0, 152, __pyx_L1_error)
4206 
4207  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":153
4208  * error,
4209  * samples,
4210  * processed_samples_indices, # <<<<<<<<<<<<<<
4211  * num_samples_used,
4212  * num_outliers,
4213  */
4214  __Pyx_TraceLine(153,0,__PYX_ERR(0, 153, __pyx_L1_error))
4215  __pyx_t_20 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_processed_samples_indices, PyBUF_WRITABLE); if (unlikely(!__pyx_t_20.memview)) __PYX_ERR(0, 153, __pyx_L1_error)
4216 
4217  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":154
4218  * samples,
4219  * processed_samples_indices,
4220  * num_samples_used, # <<<<<<<<<<<<<<
4221  * num_outliers,
4222  * converged,
4223  */
4224  __Pyx_TraceLine(154,0,__PYX_ERR(0, 154, __pyx_L1_error))
4225  __pyx_t_21 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_num_samples_used, PyBUF_WRITABLE); if (unlikely(!__pyx_t_21.memview)) __PYX_ERR(0, 154, __pyx_L1_error)
4226 
4227  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":155
4228  * processed_samples_indices,
4229  * num_samples_used,
4230  * num_outliers, # <<<<<<<<<<<<<<
4231  * converged,
4232  * alg_wall_time)
4233  */
4234  __Pyx_TraceLine(155,0,__PYX_ERR(0, 155, __pyx_L1_error))
4235  __pyx_t_22 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_num_outliers, PyBUF_WRITABLE); if (unlikely(!__pyx_t_22.memview)) __PYX_ERR(0, 155, __pyx_L1_error)
4236 
4237  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":156
4238  * num_samples_used,
4239  * num_outliers,
4240  * converged, # <<<<<<<<<<<<<<
4241  * alg_wall_time)
4242  *
4243  */
4244  __Pyx_TraceLine(156,0,__PYX_ERR(0, 156, __pyx_L1_error))
4245  __pyx_t_23 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_converged, PyBUF_WRITABLE); if (unlikely(!__pyx_t_23.memview)) __PYX_ERR(0, 156, __pyx_L1_error)
4246 
4247  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":132
4248  * elif data_type_name == b'float128':
4249  *
4250  * all_converged = _pyc_trace_estimator_long_double( # <<<<<<<<<<<<<<
4251  * Aop,
4252  * parameters,
4253  */
4254  __Pyx_TraceLine(132,0,__PYX_ERR(0, 132, __pyx_L1_error))
4255  __pyx_t_24 = __pyx_f_5imate_18_c_trace_estimator_20py_c_trace_estimator__pyc_trace_estimator_long_double(__pyx_v_Aop, __pyx_v_parameters, __pyx_t_2, __pyx_v_py_matrix_function, __pyx_t_4, __pyx_t_34, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_35, __pyx_t_10, __pyx_t_11, __pyx_t_36, __pyx_t_37, __pyx_t_38, __pyx_t_39, __pyx_t_16, __pyx_t_40, __pyx_t_41, __pyx_t_42, __pyx_t_20, __pyx_t_21, __pyx_t_22, __pyx_t_23, __pyx_v_alg_wall_time); if (unlikely(__pyx_t_24 == ((__pyx_t_5imate_12_definitions_5types_FlagType)-1) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error)
4256  __PYX_XDEC_MEMVIEW(&__pyx_t_40, 1);
4257  __pyx_t_40.memview = NULL;
4258  __pyx_t_40.data = NULL;
4259  __PYX_XDEC_MEMVIEW(&__pyx_t_41, 1);
4260  __pyx_t_41.memview = NULL;
4261  __pyx_t_41.data = NULL;
4262  __PYX_XDEC_MEMVIEW(&__pyx_t_42, 1);
4263  __pyx_t_42.memview = NULL;
4264  __pyx_t_42.data = NULL;
4265  __PYX_XDEC_MEMVIEW(&__pyx_t_20, 1);
4266  __pyx_t_20.memview = NULL;
4267  __pyx_t_20.data = NULL;
4268  __PYX_XDEC_MEMVIEW(&__pyx_t_21, 1);
4269  __pyx_t_21.memview = NULL;
4270  __pyx_t_21.data = NULL;
4271  __PYX_XDEC_MEMVIEW(&__pyx_t_22, 1);
4272  __pyx_t_22.memview = NULL;
4273  __pyx_t_22.data = NULL;
4274  __PYX_XDEC_MEMVIEW(&__pyx_t_23, 1);
4275  __pyx_t_23.memview = NULL;
4276  __pyx_t_23.data = NULL;
4277  __pyx_v_all_converged = __pyx_t_24;
4278 
4279  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":130
4280  * alg_wall_time)
4281  *
4282  * elif data_type_name == b'float128': # <<<<<<<<<<<<<<
4283  *
4284  * all_converged = _pyc_trace_estimator_long_double(
4285  */
4286  goto __pyx_L3;
4287  }
4288 
4289  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":160
4290  *
4291  * else:
4292  * raise TypeError('Data type should be "float32", "float64", or ' + # <<<<<<<<<<<<<<
4293  * '"float128".')
4294  *
4295  */
4296  __Pyx_TraceLine(160,0,__PYX_ERR(0, 160, __pyx_L1_error))
4297  /*else*/ {
4298  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 160, __pyx_L1_error)
4299  __Pyx_GOTREF(__pyx_t_3);
4300  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
4301  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4302  __PYX_ERR(0, 160, __pyx_L1_error)
4303  }
4304  __pyx_L3:;
4305 
4306  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":164
4307  *
4308  * # Return gpu proc time via a numpy array of size 1
4309  * alg_wall_times[0] = alg_wall_time # <<<<<<<<<<<<<<
4310  *
4311  * return all_converged
4312  */
4313  __Pyx_TraceLine(164,0,__PYX_ERR(0, 164, __pyx_L1_error))
4314  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_alg_wall_time); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 164, __pyx_L1_error)
4315  __Pyx_GOTREF(__pyx_t_3);
4316  if (unlikely(__Pyx_SetItemInt(__pyx_v_alg_wall_times, 0, __pyx_t_3, long, 1, __Pyx_PyInt_From_long, 0, 0, 0) < 0)) __PYX_ERR(0, 164, __pyx_L1_error)
4317  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4318 
4319  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":166
4320  * alg_wall_times[0] = alg_wall_time
4321  *
4322  * return all_converged # <<<<<<<<<<<<<<
4323  *
4324  *
4325  */
4326  __Pyx_TraceLine(166,0,__PYX_ERR(0, 166, __pyx_L1_error))
4327  __pyx_r = __pyx_v_all_converged;
4328  goto __pyx_L0;
4329 
4330  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":39
4331  * # ===================
4332  *
4333  * cpdef FlagType pyc_trace_estimator( # <<<<<<<<<<<<<<
4334  * pycLinearOperator Aop,
4335  * parameters,
4336  */
4337 
4338  /* function exit code */
4339  __pyx_L1_error:;
4340  __Pyx_XDECREF(__pyx_t_3);
4341  __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);
4342  __PYX_XDEC_MEMVIEW(&__pyx_t_18, 1);
4343  __PYX_XDEC_MEMVIEW(&__pyx_t_19, 1);
4344  __PYX_XDEC_MEMVIEW(&__pyx_t_20, 1);
4345  __PYX_XDEC_MEMVIEW(&__pyx_t_21, 1);
4346  __PYX_XDEC_MEMVIEW(&__pyx_t_22, 1);
4347  __PYX_XDEC_MEMVIEW(&__pyx_t_23, 1);
4348  __PYX_XDEC_MEMVIEW(&__pyx_t_31, 1);
4349  __PYX_XDEC_MEMVIEW(&__pyx_t_32, 1);
4350  __PYX_XDEC_MEMVIEW(&__pyx_t_33, 1);
4351  __PYX_XDEC_MEMVIEW(&__pyx_t_40, 1);
4352  __PYX_XDEC_MEMVIEW(&__pyx_t_41, 1);
4353  __PYX_XDEC_MEMVIEW(&__pyx_t_42, 1);
4354  __Pyx_AddTraceback("imate._c_trace_estimator.py_c_trace_estimator.pyc_trace_estimator", __pyx_clineno, __pyx_lineno, __pyx_filename);
4355  __pyx_r = -1;
4356  __pyx_L0:;
4357  __Pyx_TraceReturn(Py_None, 0);
4358  __Pyx_RefNannyFinishContext();
4359  return __pyx_r;
4360 }
4361 
4362 /* Python wrapper */
4363 static PyObject *__pyx_pw_5imate_18_c_trace_estimator_20py_c_trace_estimator_1pyc_trace_estimator(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4364 static char __pyx_doc_5imate_18_c_trace_estimator_20py_c_trace_estimator_pyc_trace_estimator[] = "pyc_trace_estimator(pycLinearOperator Aop, parameters, num_inquiries, pyFunction py_matrix_function, gram, exponent, reorthogonalize, seed, lanczos_degree, lanczos_tol, min_num_samples, max_num_samples, error_atol, error_rtol, confidence_level, outlier_significance_level, num_threads, data_type_name, trace, error, samples, processed_samples_indices, num_samples_used, num_outliers, converged, alg_wall_times) -> FlagType\n\n ";
4365 static PyMethodDef __pyx_mdef_5imate_18_c_trace_estimator_20py_c_trace_estimator_1pyc_trace_estimator = {"pyc_trace_estimator", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_trace_estimator_20py_c_trace_estimator_1pyc_trace_estimator, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_trace_estimator_20py_c_trace_estimator_pyc_trace_estimator};
4366 static PyObject *__pyx_pw_5imate_18_c_trace_estimator_20py_c_trace_estimator_1pyc_trace_estimator(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4367  struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_Aop = 0;
4368  PyObject *__pyx_v_parameters = 0;
4369  PyObject *__pyx_v_num_inquiries = 0;
4370  struct __pyx_obj_5imate_9functions_12py_functions_pyFunction *__pyx_v_py_matrix_function = 0;
4371  PyObject *__pyx_v_gram = 0;
4372  PyObject *__pyx_v_exponent = 0;
4373  PyObject *__pyx_v_reorthogonalize = 0;
4374  PyObject *__pyx_v_seed = 0;
4375  PyObject *__pyx_v_lanczos_degree = 0;
4376  PyObject *__pyx_v_lanczos_tol = 0;
4377  PyObject *__pyx_v_min_num_samples = 0;
4378  PyObject *__pyx_v_max_num_samples = 0;
4379  PyObject *__pyx_v_error_atol = 0;
4380  PyObject *__pyx_v_error_rtol = 0;
4381  PyObject *__pyx_v_confidence_level = 0;
4382  PyObject *__pyx_v_outlier_significance_level = 0;
4383  PyObject *__pyx_v_num_threads = 0;
4384  PyObject *__pyx_v_data_type_name = 0;
4385  PyObject *__pyx_v_trace = 0;
4386  PyObject *__pyx_v_error = 0;
4387  PyObject *__pyx_v_samples = 0;
4388  PyObject *__pyx_v_processed_samples_indices = 0;
4389  PyObject *__pyx_v_num_samples_used = 0;
4390  PyObject *__pyx_v_num_outliers = 0;
4391  PyObject *__pyx_v_converged = 0;
4392  PyObject *__pyx_v_alg_wall_times = 0;
4393  int __pyx_lineno = 0;
4394  const char *__pyx_filename = NULL;
4395  int __pyx_clineno = 0;
4396  PyObject *__pyx_r = 0;
4397  __Pyx_RefNannyDeclarations
4398  __Pyx_RefNannySetupContext("pyc_trace_estimator (wrapper)", 0);
4399  {
4400  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_Aop,&__pyx_n_s_parameters,&__pyx_n_s_num_inquiries,&__pyx_n_s_py_matrix_function,&__pyx_n_s_gram,&__pyx_n_s_exponent,&__pyx_n_s_reorthogonalize,&__pyx_n_s_seed,&__pyx_n_s_lanczos_degree,&__pyx_n_s_lanczos_tol,&__pyx_n_s_min_num_samples,&__pyx_n_s_max_num_samples,&__pyx_n_s_error_atol,&__pyx_n_s_error_rtol,&__pyx_n_s_confidence_level,&__pyx_n_s_outlier_significance_level,&__pyx_n_s_num_threads,&__pyx_n_s_data_type_name,&__pyx_n_s_trace,&__pyx_n_s_error,&__pyx_n_s_samples,&__pyx_n_s_processed_samples_indices,&__pyx_n_s_num_samples_used,&__pyx_n_s_num_outliers,&__pyx_n_s_converged,&__pyx_n_s_alg_wall_times,0};
4401  PyObject* values[26] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
4402  if (unlikely(__pyx_kwds)) {
4403  Py_ssize_t kw_args;
4404  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4405  switch (pos_args) {
4406  case 26: values[25] = PyTuple_GET_ITEM(__pyx_args, 25);
4407  CYTHON_FALLTHROUGH;
4408  case 25: values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
4409  CYTHON_FALLTHROUGH;
4410  case 24: values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
4411  CYTHON_FALLTHROUGH;
4412  case 23: values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
4413  CYTHON_FALLTHROUGH;
4414  case 22: values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
4415  CYTHON_FALLTHROUGH;
4416  case 21: values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
4417  CYTHON_FALLTHROUGH;
4418  case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
4419  CYTHON_FALLTHROUGH;
4420  case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
4421  CYTHON_FALLTHROUGH;
4422  case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
4423  CYTHON_FALLTHROUGH;
4424  case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
4425  CYTHON_FALLTHROUGH;
4426  case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
4427  CYTHON_FALLTHROUGH;
4428  case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
4429  CYTHON_FALLTHROUGH;
4430  case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
4431  CYTHON_FALLTHROUGH;
4432  case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
4433  CYTHON_FALLTHROUGH;
4434  case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
4435  CYTHON_FALLTHROUGH;
4436  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
4437  CYTHON_FALLTHROUGH;
4438  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
4439  CYTHON_FALLTHROUGH;
4440  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
4441  CYTHON_FALLTHROUGH;
4442  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
4443  CYTHON_FALLTHROUGH;
4444  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
4445  CYTHON_FALLTHROUGH;
4446  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4447  CYTHON_FALLTHROUGH;
4448  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4449  CYTHON_FALLTHROUGH;
4450  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4451  CYTHON_FALLTHROUGH;
4452  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4453  CYTHON_FALLTHROUGH;
4454  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4455  CYTHON_FALLTHROUGH;
4456  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4457  CYTHON_FALLTHROUGH;
4458  case 0: break;
4459  default: goto __pyx_L5_argtuple_error;
4460  }
4461  kw_args = PyDict_Size(__pyx_kwds);
4462  switch (pos_args) {
4463  case 0:
4464  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Aop)) != 0)) kw_args--;
4465  else goto __pyx_L5_argtuple_error;
4466  CYTHON_FALLTHROUGH;
4467  case 1:
4468  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parameters)) != 0)) kw_args--;
4469  else {
4470  __Pyx_RaiseArgtupleInvalid("pyc_trace_estimator", 1, 26, 26, 1); __PYX_ERR(0, 39, __pyx_L3_error)
4471  }
4472  CYTHON_FALLTHROUGH;
4473  case 2:
4474  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_num_inquiries)) != 0)) kw_args--;
4475  else {
4476  __Pyx_RaiseArgtupleInvalid("pyc_trace_estimator", 1, 26, 26, 2); __PYX_ERR(0, 39, __pyx_L3_error)
4477  }
4478  CYTHON_FALLTHROUGH;
4479  case 3:
4480  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_py_matrix_function)) != 0)) kw_args--;
4481  else {
4482  __Pyx_RaiseArgtupleInvalid("pyc_trace_estimator", 1, 26, 26, 3); __PYX_ERR(0, 39, __pyx_L3_error)
4483  }
4484  CYTHON_FALLTHROUGH;
4485  case 4:
4486  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_gram)) != 0)) kw_args--;
4487  else {
4488  __Pyx_RaiseArgtupleInvalid("pyc_trace_estimator", 1, 26, 26, 4); __PYX_ERR(0, 39, __pyx_L3_error)
4489  }
4490  CYTHON_FALLTHROUGH;
4491  case 5:
4492  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exponent)) != 0)) kw_args--;
4493  else {
4494  __Pyx_RaiseArgtupleInvalid("pyc_trace_estimator", 1, 26, 26, 5); __PYX_ERR(0, 39, __pyx_L3_error)
4495  }
4496  CYTHON_FALLTHROUGH;
4497  case 6:
4498  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_reorthogonalize)) != 0)) kw_args--;
4499  else {
4500  __Pyx_RaiseArgtupleInvalid("pyc_trace_estimator", 1, 26, 26, 6); __PYX_ERR(0, 39, __pyx_L3_error)
4501  }
4502  CYTHON_FALLTHROUGH;
4503  case 7:
4504  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_seed)) != 0)) kw_args--;
4505  else {
4506  __Pyx_RaiseArgtupleInvalid("pyc_trace_estimator", 1, 26, 26, 7); __PYX_ERR(0, 39, __pyx_L3_error)
4507  }
4508  CYTHON_FALLTHROUGH;
4509  case 8:
4510  if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lanczos_degree)) != 0)) kw_args--;
4511  else {
4512  __Pyx_RaiseArgtupleInvalid("pyc_trace_estimator", 1, 26, 26, 8); __PYX_ERR(0, 39, __pyx_L3_error)
4513  }
4514  CYTHON_FALLTHROUGH;
4515  case 9:
4516  if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lanczos_tol)) != 0)) kw_args--;
4517  else {
4518  __Pyx_RaiseArgtupleInvalid("pyc_trace_estimator", 1, 26, 26, 9); __PYX_ERR(0, 39, __pyx_L3_error)
4519  }
4520  CYTHON_FALLTHROUGH;
4521  case 10:
4522  if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_min_num_samples)) != 0)) kw_args--;
4523  else {
4524  __Pyx_RaiseArgtupleInvalid("pyc_trace_estimator", 1, 26, 26, 10); __PYX_ERR(0, 39, __pyx_L3_error)
4525  }
4526  CYTHON_FALLTHROUGH;
4527  case 11:
4528  if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_num_samples)) != 0)) kw_args--;
4529  else {
4530  __Pyx_RaiseArgtupleInvalid("pyc_trace_estimator", 1, 26, 26, 11); __PYX_ERR(0, 39, __pyx_L3_error)
4531  }
4532  CYTHON_FALLTHROUGH;
4533  case 12:
4534  if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_error_atol)) != 0)) kw_args--;
4535  else {
4536  __Pyx_RaiseArgtupleInvalid("pyc_trace_estimator", 1, 26, 26, 12); __PYX_ERR(0, 39, __pyx_L3_error)
4537  }
4538  CYTHON_FALLTHROUGH;
4539  case 13:
4540  if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_error_rtol)) != 0)) kw_args--;
4541  else {
4542  __Pyx_RaiseArgtupleInvalid("pyc_trace_estimator", 1, 26, 26, 13); __PYX_ERR(0, 39, __pyx_L3_error)
4543  }
4544  CYTHON_FALLTHROUGH;
4545  case 14:
4546  if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_confidence_level)) != 0)) kw_args--;
4547  else {
4548  __Pyx_RaiseArgtupleInvalid("pyc_trace_estimator", 1, 26, 26, 14); __PYX_ERR(0, 39, __pyx_L3_error)
4549  }
4550  CYTHON_FALLTHROUGH;
4551  case 15:
4552  if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_outlier_significance_level)) != 0)) kw_args--;
4553  else {
4554  __Pyx_RaiseArgtupleInvalid("pyc_trace_estimator", 1, 26, 26, 15); __PYX_ERR(0, 39, __pyx_L3_error)
4555  }
4556  CYTHON_FALLTHROUGH;
4557  case 16:
4558  if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_num_threads)) != 0)) kw_args--;
4559  else {
4560  __Pyx_RaiseArgtupleInvalid("pyc_trace_estimator", 1, 26, 26, 16); __PYX_ERR(0, 39, __pyx_L3_error)
4561  }
4562  CYTHON_FALLTHROUGH;
4563  case 17:
4564  if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data_type_name)) != 0)) kw_args--;
4565  else {
4566  __Pyx_RaiseArgtupleInvalid("pyc_trace_estimator", 1, 26, 26, 17); __PYX_ERR(0, 39, __pyx_L3_error)
4567  }
4568  CYTHON_FALLTHROUGH;
4569  case 18:
4570  if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_trace)) != 0)) kw_args--;
4571  else {
4572  __Pyx_RaiseArgtupleInvalid("pyc_trace_estimator", 1, 26, 26, 18); __PYX_ERR(0, 39, __pyx_L3_error)
4573  }
4574  CYTHON_FALLTHROUGH;
4575  case 19:
4576  if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_error)) != 0)) kw_args--;
4577  else {
4578  __Pyx_RaiseArgtupleInvalid("pyc_trace_estimator", 1, 26, 26, 19); __PYX_ERR(0, 39, __pyx_L3_error)
4579  }
4580  CYTHON_FALLTHROUGH;
4581  case 20:
4582  if (likely((values[20] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_samples)) != 0)) kw_args--;
4583  else {
4584  __Pyx_RaiseArgtupleInvalid("pyc_trace_estimator", 1, 26, 26, 20); __PYX_ERR(0, 39, __pyx_L3_error)
4585  }
4586  CYTHON_FALLTHROUGH;
4587  case 21:
4588  if (likely((values[21] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_processed_samples_indices)) != 0)) kw_args--;
4589  else {
4590  __Pyx_RaiseArgtupleInvalid("pyc_trace_estimator", 1, 26, 26, 21); __PYX_ERR(0, 39, __pyx_L3_error)
4591  }
4592  CYTHON_FALLTHROUGH;
4593  case 22:
4594  if (likely((values[22] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_num_samples_used)) != 0)) kw_args--;
4595  else {
4596  __Pyx_RaiseArgtupleInvalid("pyc_trace_estimator", 1, 26, 26, 22); __PYX_ERR(0, 39, __pyx_L3_error)
4597  }
4598  CYTHON_FALLTHROUGH;
4599  case 23:
4600  if (likely((values[23] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_num_outliers)) != 0)) kw_args--;
4601  else {
4602  __Pyx_RaiseArgtupleInvalid("pyc_trace_estimator", 1, 26, 26, 23); __PYX_ERR(0, 39, __pyx_L3_error)
4603  }
4604  CYTHON_FALLTHROUGH;
4605  case 24:
4606  if (likely((values[24] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_converged)) != 0)) kw_args--;
4607  else {
4608  __Pyx_RaiseArgtupleInvalid("pyc_trace_estimator", 1, 26, 26, 24); __PYX_ERR(0, 39, __pyx_L3_error)
4609  }
4610  CYTHON_FALLTHROUGH;
4611  case 25:
4612  if (likely((values[25] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alg_wall_times)) != 0)) kw_args--;
4613  else {
4614  __Pyx_RaiseArgtupleInvalid("pyc_trace_estimator", 1, 26, 26, 25); __PYX_ERR(0, 39, __pyx_L3_error)
4615  }
4616  }
4617  if (unlikely(kw_args > 0)) {
4618  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pyc_trace_estimator") < 0)) __PYX_ERR(0, 39, __pyx_L3_error)
4619  }
4620  } else if (PyTuple_GET_SIZE(__pyx_args) != 26) {
4621  goto __pyx_L5_argtuple_error;
4622  } else {
4623  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4624  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4625  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4626  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4627  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4628  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4629  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
4630  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
4631  values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
4632  values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
4633  values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
4634  values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
4635  values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
4636  values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
4637  values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
4638  values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
4639  values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
4640  values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
4641  values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
4642  values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
4643  values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
4644  values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
4645  values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
4646  values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
4647  values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
4648  values[25] = PyTuple_GET_ITEM(__pyx_args, 25);
4649  }
4650  __pyx_v_Aop = ((struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *)values[0]);
4651  __pyx_v_parameters = values[1];
4652  __pyx_v_num_inquiries = values[2];
4653  __pyx_v_py_matrix_function = ((struct __pyx_obj_5imate_9functions_12py_functions_pyFunction *)values[3]);
4654  __pyx_v_gram = values[4];
4655  __pyx_v_exponent = values[5];
4656  __pyx_v_reorthogonalize = values[6];
4657  __pyx_v_seed = values[7];
4658  __pyx_v_lanczos_degree = values[8];
4659  __pyx_v_lanczos_tol = values[9];
4660  __pyx_v_min_num_samples = values[10];
4661  __pyx_v_max_num_samples = values[11];
4662  __pyx_v_error_atol = values[12];
4663  __pyx_v_error_rtol = values[13];
4664  __pyx_v_confidence_level = values[14];
4665  __pyx_v_outlier_significance_level = values[15];
4666  __pyx_v_num_threads = values[16];
4667  __pyx_v_data_type_name = values[17];
4668  __pyx_v_trace = values[18];
4669  __pyx_v_error = values[19];
4670  __pyx_v_samples = values[20];
4671  __pyx_v_processed_samples_indices = values[21];
4672  __pyx_v_num_samples_used = values[22];
4673  __pyx_v_num_outliers = values[23];
4674  __pyx_v_converged = values[24];
4675  __pyx_v_alg_wall_times = values[25];
4676  }
4677  goto __pyx_L4_argument_unpacking_done;
4678  __pyx_L5_argtuple_error:;
4679  __Pyx_RaiseArgtupleInvalid("pyc_trace_estimator", 1, 26, 26, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 39, __pyx_L3_error)
4680  __pyx_L3_error:;
4681  __Pyx_AddTraceback("imate._c_trace_estimator.py_c_trace_estimator.pyc_trace_estimator", __pyx_clineno, __pyx_lineno, __pyx_filename);
4682  __Pyx_RefNannyFinishContext();
4683  return NULL;
4684  __pyx_L4_argument_unpacking_done:;
4685  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_Aop), __pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator, 1, "Aop", 0))) __PYX_ERR(0, 40, __pyx_L1_error)
4686  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_py_matrix_function), __pyx_ptype_5imate_9functions_12py_functions_pyFunction, 1, "py_matrix_function", 0))) __PYX_ERR(0, 43, __pyx_L1_error)
4687  __pyx_r = __pyx_pf_5imate_18_c_trace_estimator_20py_c_trace_estimator_pyc_trace_estimator(__pyx_self, __pyx_v_Aop, __pyx_v_parameters, __pyx_v_num_inquiries, __pyx_v_py_matrix_function, __pyx_v_gram, __pyx_v_exponent, __pyx_v_reorthogonalize, __pyx_v_seed, __pyx_v_lanczos_degree, __pyx_v_lanczos_tol, __pyx_v_min_num_samples, __pyx_v_max_num_samples, __pyx_v_error_atol, __pyx_v_error_rtol, __pyx_v_confidence_level, __pyx_v_outlier_significance_level, __pyx_v_num_threads, __pyx_v_data_type_name, __pyx_v_trace, __pyx_v_error, __pyx_v_samples, __pyx_v_processed_samples_indices, __pyx_v_num_samples_used, __pyx_v_num_outliers, __pyx_v_converged, __pyx_v_alg_wall_times);
4688 
4689  /* function exit code */
4690  goto __pyx_L0;
4691  __pyx_L1_error:;
4692  __pyx_r = NULL;
4693  __pyx_L0:;
4694  __Pyx_RefNannyFinishContext();
4695  return __pyx_r;
4696 }
4697 
4698 static PyObject *__pyx_pf_5imate_18_c_trace_estimator_20py_c_trace_estimator_pyc_trace_estimator(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_Aop, PyObject *__pyx_v_parameters, PyObject *__pyx_v_num_inquiries, struct __pyx_obj_5imate_9functions_12py_functions_pyFunction *__pyx_v_py_matrix_function, PyObject *__pyx_v_gram, PyObject *__pyx_v_exponent, PyObject *__pyx_v_reorthogonalize, PyObject *__pyx_v_seed, PyObject *__pyx_v_lanczos_degree, PyObject *__pyx_v_lanczos_tol, PyObject *__pyx_v_min_num_samples, PyObject *__pyx_v_max_num_samples, PyObject *__pyx_v_error_atol, PyObject *__pyx_v_error_rtol, PyObject *__pyx_v_confidence_level, PyObject *__pyx_v_outlier_significance_level, PyObject *__pyx_v_num_threads, PyObject *__pyx_v_data_type_name, PyObject *__pyx_v_trace, PyObject *__pyx_v_error, PyObject *__pyx_v_samples, PyObject *__pyx_v_processed_samples_indices, PyObject *__pyx_v_num_samples_used, PyObject *__pyx_v_num_outliers, PyObject *__pyx_v_converged, PyObject *__pyx_v_alg_wall_times) {
4699  PyObject *__pyx_r = NULL;
4700  __Pyx_TraceDeclarations
4701  __Pyx_RefNannyDeclarations
4702  __pyx_t_5imate_12_definitions_5types_FlagType __pyx_t_1;
4703  PyObject *__pyx_t_2 = NULL;
4704  int __pyx_lineno = 0;
4705  const char *__pyx_filename = NULL;
4706  int __pyx_clineno = 0;
4707  __Pyx_TraceFrameInit(__pyx_codeobj_)
4708  __Pyx_RefNannySetupContext("pyc_trace_estimator", 0);
4709  __Pyx_TraceCall("pyc_trace_estimator (wrapper)", __pyx_f[0], 39, 0, __PYX_ERR(0, 39, __pyx_L1_error));
4710  __Pyx_XDECREF(__pyx_r);
4711  __pyx_t_1 = __pyx_f_5imate_18_c_trace_estimator_20py_c_trace_estimator_pyc_trace_estimator(__pyx_v_Aop, __pyx_v_parameters, __pyx_v_num_inquiries, __pyx_v_py_matrix_function, __pyx_v_gram, __pyx_v_exponent, __pyx_v_reorthogonalize, __pyx_v_seed, __pyx_v_lanczos_degree, __pyx_v_lanczos_tol, __pyx_v_min_num_samples, __pyx_v_max_num_samples, __pyx_v_error_atol, __pyx_v_error_rtol, __pyx_v_confidence_level, __pyx_v_outlier_significance_level, __pyx_v_num_threads, __pyx_v_data_type_name, __pyx_v_trace, __pyx_v_error, __pyx_v_samples, __pyx_v_processed_samples_indices, __pyx_v_num_samples_used, __pyx_v_num_outliers, __pyx_v_converged, __pyx_v_alg_wall_times, 0); if (unlikely(__pyx_t_1 == ((__pyx_t_5imate_12_definitions_5types_FlagType)-1) && PyErr_Occurred())) __PYX_ERR(0, 39, __pyx_L1_error)
4712  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error)
4713  __Pyx_GOTREF(__pyx_t_2);
4714  __pyx_r = __pyx_t_2;
4715  __pyx_t_2 = 0;
4716  goto __pyx_L0;
4717 
4718  /* function exit code */
4719  __pyx_L1_error:;
4720  __Pyx_XDECREF(__pyx_t_2);
4721  __Pyx_AddTraceback("imate._c_trace_estimator.py_c_trace_estimator.pyc_trace_estimator", __pyx_clineno, __pyx_lineno, __pyx_filename);
4722  __pyx_r = NULL;
4723  __pyx_L0:;
4724  __Pyx_XGIVEREF(__pyx_r);
4725  __Pyx_TraceReturn(__pyx_r, 0);
4726  __Pyx_RefNannyFinishContext();
4727  return __pyx_r;
4728 }
4729 
4730 /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":173
4731  * # =========================
4732  *
4733  * cdef FlagType _pyc_trace_estimator_float( # <<<<<<<<<<<<<<
4734  * pycLinearOperator Aop,
4735  * parameters,
4736  */
4737 
4738 static __pyx_t_5imate_12_definitions_5types_FlagType __pyx_f_5imate_18_c_trace_estimator_20py_c_trace_estimator__pyc_trace_estimator_float(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_Aop, PyObject *__pyx_v_parameters, __pyx_t_5imate_12_definitions_5types_IndexType const __pyx_v_num_inquiries, struct __pyx_obj_5imate_9functions_12py_functions_pyFunction *__pyx_v_py_matrix_function, __pyx_t_5imate_12_definitions_5types_FlagType const __pyx_v_gram, float const __pyx_v_exponent, __pyx_t_5imate_12_definitions_5types_FlagType const __pyx_v_reorthogonalize, int64_t const __pyx_v_seed, __pyx_t_5imate_12_definitions_5types_IndexType const __pyx_v_lanczos_degree, float const __pyx_v_lanczos_tol, __pyx_t_5imate_12_definitions_5types_IndexType const __pyx_v_min_num_samples, __pyx_t_5imate_12_definitions_5types_IndexType const __pyx_v_max_num_samples, float const __pyx_v_error_atol, float const __pyx_v_error_rtol, float const __pyx_v_confidence_level, float const __pyx_v_outlier_significance_level, __pyx_t_5imate_12_definitions_5types_IndexType const __pyx_v_num_threads, __Pyx_memviewslice __pyx_v_trace, __Pyx_memviewslice __pyx_v_error, __Pyx_memviewslice __pyx_v_samples, __pyx_t_5imate_12_definitions_5types_MemoryViewIndexType __pyx_v_processed_samples_indices, __pyx_t_5imate_12_definitions_5types_MemoryViewIndexType __pyx_v_num_samples_used, __pyx_t_5imate_12_definitions_5types_MemoryViewIndexType __pyx_v_num_outliers, __pyx_t_5imate_12_definitions_5types_MemoryViewFlagType __pyx_v_converged, float &__pyx_v_alg_wall_time) {
4739  float *__pyx_v_c_parameters;
4740  float __pyx_v_scalar_parameters;
4741  __Pyx_memviewslice __pyx_v_array_parameters = { 0, 0, { 0 }, { 0 }, { 0 } };
4742  float *__pyx_v_c_trace;
4743  float *__pyx_v_c_error;
4744  __pyx_t_5imate_12_definitions_5types_IndexType *__pyx_v_c_processed_samples_indices;
4745  __pyx_t_5imate_12_definitions_5types_IndexType *__pyx_v_c_num_samples_used;
4746  __pyx_t_5imate_12_definitions_5types_IndexType *__pyx_v_c_num_outliers;
4747  __pyx_t_5imate_12_definitions_5types_FlagType *__pyx_v_c_converged;
4748  float **__pyx_v_c_samples;
4749  __pyx_t_5imate_12_definitions_5types_IndexType __pyx_v_i;
4750  __pyx_t_5imate_12_definitions_5types_IndexType __pyx_v_j;
4751  cLinearOperator<float> *__pyx_v_Aop_float;
4752  Function *__pyx_v_matrix_function;
4753  __pyx_t_5imate_12_definitions_5types_FlagType __pyx_v_all_converged;
4754  __pyx_t_5imate_12_definitions_5types_FlagType __pyx_r;
4755  __Pyx_TraceDeclarations
4756  __Pyx_RefNannyDeclarations
4757  int __pyx_t_1;
4758  int __pyx_t_2;
4759  PyObject *__pyx_t_3 = NULL;
4760  PyObject *__pyx_t_4 = NULL;
4761  PyObject *__pyx_t_5 = NULL;
4762  float __pyx_t_6;
4763  __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
4764  Py_ssize_t __pyx_t_8;
4765  __pyx_t_5imate_12_definitions_5types_IndexType __pyx_t_9;
4766  __pyx_t_5imate_12_definitions_5types_IndexType __pyx_t_10;
4767  __pyx_t_5imate_12_definitions_5types_IndexType __pyx_t_11;
4768  __pyx_t_5imate_12_definitions_5types_IndexType __pyx_t_12;
4769  __pyx_t_5imate_12_definitions_5types_IndexType __pyx_t_13;
4770  __pyx_t_5imate_12_definitions_5types_IndexType __pyx_t_14;
4771  cLinearOperator<float> *__pyx_t_15;
4772  int __pyx_t_16;
4773  int __pyx_t_17;
4774  Py_ssize_t __pyx_t_18;
4775  Py_ssize_t __pyx_t_19;
4776  int __pyx_lineno = 0;
4777  const char *__pyx_filename = NULL;
4778  int __pyx_clineno = 0;
4779  __Pyx_RefNannySetupContext("_pyc_trace_estimator_float", 0);
4780  __Pyx_TraceCall("_pyc_trace_estimator_float", __pyx_f[0], 173, 0, __PYX_ERR(0, 173, __pyx_L1_error));
4781 
4782  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":207
4783  * cdef float[:] array_parameters
4784  *
4785  * if parameters is None: # <<<<<<<<<<<<<<
4786  * c_parameters = NULL
4787  *
4788  */
4789  __Pyx_TraceLine(207,0,__PYX_ERR(0, 207, __pyx_L1_error))
4790  __pyx_t_1 = (__pyx_v_parameters == Py_None);
4791  __pyx_t_2 = (__pyx_t_1 != 0);
4792  if (__pyx_t_2) {
4793 
4794  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":208
4795  *
4796  * if parameters is None:
4797  * c_parameters = NULL # <<<<<<<<<<<<<<
4798  *
4799  * elif numpy.isscalar(parameters):
4800  */
4801  __Pyx_TraceLine(208,0,__PYX_ERR(0, 208, __pyx_L1_error))
4802  __pyx_v_c_parameters = NULL;
4803 
4804  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":207
4805  * cdef float[:] array_parameters
4806  *
4807  * if parameters is None: # <<<<<<<<<<<<<<
4808  * c_parameters = NULL
4809  *
4810  */
4811  goto __pyx_L3;
4812  }
4813 
4814  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":210
4815  * c_parameters = NULL
4816  *
4817  * elif numpy.isscalar(parameters): # <<<<<<<<<<<<<<
4818  * scalar_parameters = parameters
4819  * c_parameters = &scalar_parameters
4820  */
4821  __Pyx_TraceLine(210,0,__PYX_ERR(0, 210, __pyx_L1_error))
4822  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 210, __pyx_L1_error)
4823  __Pyx_GOTREF(__pyx_t_4);
4824  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_isscalar); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 210, __pyx_L1_error)
4825  __Pyx_GOTREF(__pyx_t_5);
4826  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4827  __pyx_t_4 = NULL;
4828  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
4829  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
4830  if (likely(__pyx_t_4)) {
4831  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
4832  __Pyx_INCREF(__pyx_t_4);
4833  __Pyx_INCREF(function);
4834  __Pyx_DECREF_SET(__pyx_t_5, function);
4835  }
4836  }
4837  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_v_parameters) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_parameters);
4838  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
4839  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 210, __pyx_L1_error)
4840  __Pyx_GOTREF(__pyx_t_3);
4841  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4842  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 210, __pyx_L1_error)
4843  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4844  if (__pyx_t_2) {
4845 
4846  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":211
4847  *
4848  * elif numpy.isscalar(parameters):
4849  * scalar_parameters = parameters # <<<<<<<<<<<<<<
4850  * c_parameters = &scalar_parameters
4851  *
4852  */
4853  __Pyx_TraceLine(211,0,__PYX_ERR(0, 211, __pyx_L1_error))
4854  __pyx_t_6 = __pyx_PyFloat_AsFloat(__pyx_v_parameters); if (unlikely((__pyx_t_6 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 211, __pyx_L1_error)
4855  __pyx_v_scalar_parameters = __pyx_t_6;
4856 
4857  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":212
4858  * elif numpy.isscalar(parameters):
4859  * scalar_parameters = parameters
4860  * c_parameters = &scalar_parameters # <<<<<<<<<<<<<<
4861  *
4862  * else:
4863  */
4864  __Pyx_TraceLine(212,0,__PYX_ERR(0, 212, __pyx_L1_error))
4865  __pyx_v_c_parameters = (&__pyx_v_scalar_parameters);
4866 
4867  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":210
4868  * c_parameters = NULL
4869  *
4870  * elif numpy.isscalar(parameters): # <<<<<<<<<<<<<<
4871  * scalar_parameters = parameters
4872  * c_parameters = &scalar_parameters
4873  */
4874  goto __pyx_L3;
4875  }
4876 
4877  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":215
4878  *
4879  * else:
4880  * array_parameters = parameters # <<<<<<<<<<<<<<
4881  * c_parameters = &array_parameters[0]
4882  *
4883  */
4884  __Pyx_TraceLine(215,0,__PYX_ERR(0, 215, __pyx_L1_error))
4885  /*else*/ {
4886  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_parameters, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 215, __pyx_L1_error)
4887  __pyx_v_array_parameters = __pyx_t_7;
4888  __pyx_t_7.memview = NULL;
4889  __pyx_t_7.data = NULL;
4890 
4891  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":216
4892  * else:
4893  * array_parameters = parameters
4894  * c_parameters = &array_parameters[0] # <<<<<<<<<<<<<<
4895  *
4896  * # C pointers from memoryviews
4897  */
4898  __Pyx_TraceLine(216,0,__PYX_ERR(0, 216, __pyx_L1_error))
4899  __pyx_t_8 = 0;
4900  __pyx_v_c_parameters = (&(*((float *) ( /* dim=0 */ (__pyx_v_array_parameters.data + __pyx_t_8 * __pyx_v_array_parameters.strides[0]) ))));
4901  }
4902  __pyx_L3:;
4903 
4904  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":219
4905  *
4906  * # C pointers from memoryviews
4907  * cdef float* c_trace = &trace[0] # <<<<<<<<<<<<<<
4908  * cdef float* c_error = &error[0]
4909  * cdef IndexType* c_processed_samples_indices = &processed_samples_indices[0]
4910  */
4911  __Pyx_TraceLine(219,0,__PYX_ERR(0, 219, __pyx_L1_error))
4912  __pyx_t_8 = 0;
4913  __pyx_v_c_trace = (&(*((float *) ( /* dim=0 */ (__pyx_v_trace.data + __pyx_t_8 * __pyx_v_trace.strides[0]) ))));
4914 
4915  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":220
4916  * # C pointers from memoryviews
4917  * cdef float* c_trace = &trace[0]
4918  * cdef float* c_error = &error[0] # <<<<<<<<<<<<<<
4919  * cdef IndexType* c_processed_samples_indices = &processed_samples_indices[0]
4920  * cdef IndexType* c_num_samples_used = &num_samples_used[0]
4921  */
4922  __Pyx_TraceLine(220,0,__PYX_ERR(0, 220, __pyx_L1_error))
4923  __pyx_t_8 = 0;
4924  __pyx_v_c_error = (&(*((float *) ( /* dim=0 */ (__pyx_v_error.data + __pyx_t_8 * __pyx_v_error.strides[0]) ))));
4925 
4926  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":221
4927  * cdef float* c_trace = &trace[0]
4928  * cdef float* c_error = &error[0]
4929  * cdef IndexType* c_processed_samples_indices = &processed_samples_indices[0] # <<<<<<<<<<<<<<
4930  * cdef IndexType* c_num_samples_used = &num_samples_used[0]
4931  * cdef IndexType* c_num_outliers = &num_outliers[0]
4932  */
4933  __Pyx_TraceLine(221,0,__PYX_ERR(0, 221, __pyx_L1_error))
4934  __pyx_t_8 = 0;
4935  __pyx_v_c_processed_samples_indices = (&(*((int *) ( /* dim=0 */ (__pyx_v_processed_samples_indices.data + __pyx_t_8 * __pyx_v_processed_samples_indices.strides[0]) ))));
4936 
4937  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":222
4938  * cdef float* c_error = &error[0]
4939  * cdef IndexType* c_processed_samples_indices = &processed_samples_indices[0]
4940  * cdef IndexType* c_num_samples_used = &num_samples_used[0] # <<<<<<<<<<<<<<
4941  * cdef IndexType* c_num_outliers = &num_outliers[0]
4942  * cdef FlagType* c_converged = &converged[0]
4943  */
4944  __Pyx_TraceLine(222,0,__PYX_ERR(0, 222, __pyx_L1_error))
4945  __pyx_t_8 = 0;
4946  __pyx_v_c_num_samples_used = (&(*((int *) ( /* dim=0 */ (__pyx_v_num_samples_used.data + __pyx_t_8 * __pyx_v_num_samples_used.strides[0]) ))));
4947 
4948  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":223
4949  * cdef IndexType* c_processed_samples_indices = &processed_samples_indices[0]
4950  * cdef IndexType* c_num_samples_used = &num_samples_used[0]
4951  * cdef IndexType* c_num_outliers = &num_outliers[0] # <<<<<<<<<<<<<<
4952  * cdef FlagType* c_converged = &converged[0]
4953  *
4954  */
4955  __Pyx_TraceLine(223,0,__PYX_ERR(0, 223, __pyx_L1_error))
4956  __pyx_t_8 = 0;
4957  __pyx_v_c_num_outliers = (&(*((int *) ( /* dim=0 */ (__pyx_v_num_outliers.data + __pyx_t_8 * __pyx_v_num_outliers.strides[0]) ))));
4958 
4959  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":224
4960  * cdef IndexType* c_num_samples_used = &num_samples_used[0]
4961  * cdef IndexType* c_num_outliers = &num_outliers[0]
4962  * cdef FlagType* c_converged = &converged[0] # <<<<<<<<<<<<<<
4963  *
4964  * # For samples array, instead of memoryview, allocate a 2D C array
4965  */
4966  __Pyx_TraceLine(224,0,__PYX_ERR(0, 224, __pyx_L1_error))
4967  __pyx_t_8 = 0;
4968  __pyx_v_c_converged = (&(*((int *) ( /* dim=0 */ (__pyx_v_converged.data + __pyx_t_8 * __pyx_v_converged.strides[0]) ))));
4969 
4970  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":228
4971  * # For samples array, instead of memoryview, allocate a 2D C array
4972  * cdef float** c_samples = \
4973  * <float**> malloc(sizeof(float*) * max_num_samples) # <<<<<<<<<<<<<<
4974  * cdef IndexType i, j
4975  * for i in range(max_num_samples):
4976  */
4977  __Pyx_TraceLine(228,0,__PYX_ERR(0, 228, __pyx_L1_error))
4978  __pyx_v_c_samples = ((float **)malloc(((sizeof(float *)) * __pyx_v_max_num_samples)));
4979 
4980  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":230
4981  * <float**> malloc(sizeof(float*) * max_num_samples)
4982  * cdef IndexType i, j
4983  * for i in range(max_num_samples): # <<<<<<<<<<<<<<
4984  * c_samples[i] = <float*> malloc(sizeof(float) * num_inquiries)
4985  *
4986  */
4987  __Pyx_TraceLine(230,0,__PYX_ERR(0, 230, __pyx_L1_error))
4988  __pyx_t_9 = __pyx_v_max_num_samples;
4989  __pyx_t_10 = __pyx_t_9;
4990  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
4991  __pyx_v_i = __pyx_t_11;
4992 
4993  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":231
4994  * cdef IndexType i, j
4995  * for i in range(max_num_samples):
4996  * c_samples[i] = <float*> malloc(sizeof(float) * num_inquiries) # <<<<<<<<<<<<<<
4997  *
4998  * for j in range(num_inquiries):
4999  */
5000  __Pyx_TraceLine(231,0,__PYX_ERR(0, 231, __pyx_L1_error))
5001  (__pyx_v_c_samples[__pyx_v_i]) = ((float *)malloc(((sizeof(float)) * __pyx_v_num_inquiries)));
5002 
5003  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":233
5004  * c_samples[i] = <float*> malloc(sizeof(float) * num_inquiries)
5005  *
5006  * for j in range(num_inquiries): # <<<<<<<<<<<<<<
5007  * c_samples[i][j] = NAN
5008  *
5009  */
5010  __Pyx_TraceLine(233,0,__PYX_ERR(0, 233, __pyx_L1_error))
5011  __pyx_t_12 = __pyx_v_num_inquiries;
5012  __pyx_t_13 = __pyx_t_12;
5013  for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
5014  __pyx_v_j = __pyx_t_14;
5015 
5016  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":234
5017  *
5018  * for j in range(num_inquiries):
5019  * c_samples[i][j] = NAN # <<<<<<<<<<<<<<
5020  *
5021  * # Get cLinearOperator
5022  */
5023  __Pyx_TraceLine(234,0,__PYX_ERR(0, 234, __pyx_L1_error))
5024  ((__pyx_v_c_samples[__pyx_v_i])[__pyx_v_j]) = NAN;
5025  }
5026  }
5027 
5028  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":237
5029  *
5030  * # Get cLinearOperator
5031  * cdef cLinearOperator[float]* Aop_float = Aop.get_linear_operator_float() # <<<<<<<<<<<<<<
5032  *
5033  * cdef Function* matrix_function = py_matrix_function.get_function()
5034  */
5035  __Pyx_TraceLine(237,0,__PYX_ERR(0, 237, __pyx_L1_error))
5036  __pyx_t_15 = ((struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *)__pyx_v_Aop->__pyx_vtab)->get_linear_operator_float(__pyx_v_Aop); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 237, __pyx_L1_error)
5037  __pyx_v_Aop_float = __pyx_t_15;
5038 
5039  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":239
5040  * cdef cLinearOperator[float]* Aop_float = Aop.get_linear_operator_float()
5041  *
5042  * cdef Function* matrix_function = py_matrix_function.get_function() # <<<<<<<<<<<<<<
5043  *
5044  * # Call templated c++ module
5045  */
5046  __Pyx_TraceLine(239,0,__PYX_ERR(0, 239, __pyx_L1_error))
5047  __pyx_v_matrix_function = ((struct __pyx_vtabstruct_5imate_9functions_12py_functions_pyFunction *)__pyx_v_py_matrix_function->__pyx_vtab)->get_function(__pyx_v_py_matrix_function);
5048 
5049  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":243
5050  * # Call templated c++ module
5051  * cdef FlagType all_converged = \
5052  * cTraceEstimator[float].c_trace_estimator( # <<<<<<<<<<<<<<
5053  * Aop_float,
5054  * c_parameters,
5055  */
5056  __Pyx_TraceLine(243,0,__PYX_ERR(0, 243, __pyx_L1_error))
5057  __pyx_v_all_converged = cTraceEstimator<float> ::c_trace_estimator(__pyx_v_Aop_float, __pyx_v_c_parameters, __pyx_v_num_inquiries, __pyx_v_matrix_function, __pyx_v_gram, __pyx_v_exponent, __pyx_v_reorthogonalize, __pyx_v_seed, __pyx_v_lanczos_degree, __pyx_v_lanczos_tol, __pyx_v_min_num_samples, __pyx_v_max_num_samples, __pyx_v_error_atol, __pyx_v_error_rtol, __pyx_v_confidence_level, __pyx_v_outlier_significance_level, __pyx_v_num_threads, __pyx_v_c_trace, __pyx_v_c_error, __pyx_v_c_samples, __pyx_v_c_processed_samples_indices, __pyx_v_c_num_samples_used, __pyx_v_c_num_outliers, __pyx_v_c_converged, __pyx_v_alg_wall_time);
5058 
5059  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":272
5060  * # Write the processed samples to samples to a numpy array. The unprocessed
5061  * # elements of samples array is nan.
5062  * for j in range(num_inquiries): # <<<<<<<<<<<<<<
5063  * for i in range(num_samples_used[j]):
5064  * samples[i, j] = c_samples[processed_samples_indices[i]][j]
5065  */
5066  __Pyx_TraceLine(272,0,__PYX_ERR(0, 272, __pyx_L1_error))
5067  __pyx_t_9 = __pyx_v_num_inquiries;
5068  __pyx_t_10 = __pyx_t_9;
5069  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
5070  __pyx_v_j = __pyx_t_11;
5071 
5072  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":273
5073  * # elements of samples array is nan.
5074  * for j in range(num_inquiries):
5075  * for i in range(num_samples_used[j]): # <<<<<<<<<<<<<<
5076  * samples[i, j] = c_samples[processed_samples_indices[i]][j]
5077  * # for i in range(max_num_samples):
5078  */
5079  __Pyx_TraceLine(273,0,__PYX_ERR(0, 273, __pyx_L1_error))
5080  __pyx_t_8 = __pyx_v_j;
5081  __pyx_t_16 = (*((int *) ( /* dim=0 */ (__pyx_v_num_samples_used.data + __pyx_t_8 * __pyx_v_num_samples_used.strides[0]) )));
5082  __pyx_t_17 = __pyx_t_16;
5083  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_17; __pyx_t_12+=1) {
5084  __pyx_v_i = __pyx_t_12;
5085 
5086  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":274
5087  * for j in range(num_inquiries):
5088  * for i in range(num_samples_used[j]):
5089  * samples[i, j] = c_samples[processed_samples_indices[i]][j] # <<<<<<<<<<<<<<
5090  * # for i in range(max_num_samples):
5091  * # samples[i, j] = c_samples[i][j]
5092  */
5093  __Pyx_TraceLine(274,0,__PYX_ERR(0, 274, __pyx_L1_error))
5094  __pyx_t_8 = __pyx_v_i;
5095  __pyx_t_18 = __pyx_v_i;
5096  __pyx_t_19 = __pyx_v_j;
5097  *((float *) ( /* dim=1 */ ((char *) (((float *) ( /* dim=0 */ (__pyx_v_samples.data + __pyx_t_18 * __pyx_v_samples.strides[0]) )) + __pyx_t_19)) )) = ((__pyx_v_c_samples[(*((int *) ( /* dim=0 */ (__pyx_v_processed_samples_indices.data + __pyx_t_8 * __pyx_v_processed_samples_indices.strides[0]) )))])[__pyx_v_j]);
5098  }
5099  }
5100 
5101  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":279
5102  *
5103  * # Deallocate dynamic memory
5104  * for i in range(max_num_samples): # <<<<<<<<<<<<<<
5105  * free(c_samples[i])
5106  * free(c_samples)
5107  */
5108  __Pyx_TraceLine(279,0,__PYX_ERR(0, 279, __pyx_L1_error))
5109  __pyx_t_9 = __pyx_v_max_num_samples;
5110  __pyx_t_10 = __pyx_t_9;
5111  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
5112  __pyx_v_i = __pyx_t_11;
5113 
5114  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":280
5115  * # Deallocate dynamic memory
5116  * for i in range(max_num_samples):
5117  * free(c_samples[i]) # <<<<<<<<<<<<<<
5118  * free(c_samples)
5119  *
5120  */
5121  __Pyx_TraceLine(280,0,__PYX_ERR(0, 280, __pyx_L1_error))
5122  free((__pyx_v_c_samples[__pyx_v_i]));
5123  }
5124 
5125  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":281
5126  * for i in range(max_num_samples):
5127  * free(c_samples[i])
5128  * free(c_samples) # <<<<<<<<<<<<<<
5129  *
5130  * return all_converged
5131  */
5132  __Pyx_TraceLine(281,0,__PYX_ERR(0, 281, __pyx_L1_error))
5133  free(__pyx_v_c_samples);
5134 
5135  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":283
5136  * free(c_samples)
5137  *
5138  * return all_converged # <<<<<<<<<<<<<<
5139  *
5140  *
5141  */
5142  __Pyx_TraceLine(283,0,__PYX_ERR(0, 283, __pyx_L1_error))
5143  __pyx_r = __pyx_v_all_converged;
5144  goto __pyx_L0;
5145 
5146  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":173
5147  * # =========================
5148  *
5149  * cdef FlagType _pyc_trace_estimator_float( # <<<<<<<<<<<<<<
5150  * pycLinearOperator Aop,
5151  * parameters,
5152  */
5153 
5154  /* function exit code */
5155  __pyx_L1_error:;
5156  __Pyx_XDECREF(__pyx_t_3);
5157  __Pyx_XDECREF(__pyx_t_4);
5158  __Pyx_XDECREF(__pyx_t_5);
5159  __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
5160  __Pyx_AddTraceback("imate._c_trace_estimator.py_c_trace_estimator._pyc_trace_estimator_float", __pyx_clineno, __pyx_lineno, __pyx_filename);
5161  __pyx_r = -1;
5162  __pyx_L0:;
5163  __PYX_XDEC_MEMVIEW(&__pyx_v_array_parameters, 1);
5164  __Pyx_TraceReturn(Py_None, 0);
5165  __Pyx_RefNannyFinishContext();
5166  return __pyx_r;
5167 }
5168 
5169 /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":290
5170  * # ==========================
5171  *
5172  * cdef FlagType _pyc_trace_estimator_double( # <<<<<<<<<<<<<<
5173  * pycLinearOperator Aop,
5174  * parameters,
5175  */
5176 
5177 static __pyx_t_5imate_12_definitions_5types_FlagType __pyx_f_5imate_18_c_trace_estimator_20py_c_trace_estimator__pyc_trace_estimator_double(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_Aop, PyObject *__pyx_v_parameters, __pyx_t_5imate_12_definitions_5types_IndexType const __pyx_v_num_inquiries, struct __pyx_obj_5imate_9functions_12py_functions_pyFunction *__pyx_v_py_matrix_function, __pyx_t_5imate_12_definitions_5types_FlagType const __pyx_v_gram, double const __pyx_v_exponent, __pyx_t_5imate_12_definitions_5types_FlagType const __pyx_v_reorthogonalize, int64_t const __pyx_v_seed, __pyx_t_5imate_12_definitions_5types_IndexType const __pyx_v_lanczos_degree, double const __pyx_v_lanczos_tol, __pyx_t_5imate_12_definitions_5types_IndexType const __pyx_v_min_num_samples, __pyx_t_5imate_12_definitions_5types_IndexType const __pyx_v_max_num_samples, double const __pyx_v_error_atol, double const __pyx_v_error_rtol, double const __pyx_v_confidence_level, double const __pyx_v_outlier_significance_level, __pyx_t_5imate_12_definitions_5types_IndexType const __pyx_v_num_threads, __Pyx_memviewslice __pyx_v_trace, __Pyx_memviewslice __pyx_v_error, __Pyx_memviewslice __pyx_v_samples, __pyx_t_5imate_12_definitions_5types_MemoryViewIndexType __pyx_v_processed_samples_indices, __pyx_t_5imate_12_definitions_5types_MemoryViewIndexType __pyx_v_num_samples_used, __pyx_t_5imate_12_definitions_5types_MemoryViewIndexType __pyx_v_num_outliers, __pyx_t_5imate_12_definitions_5types_MemoryViewFlagType __pyx_v_converged, float &__pyx_v_alg_wall_time) {
5178  double *__pyx_v_c_parameters;
5179  double __pyx_v_scalar_parameters;
5180  __Pyx_memviewslice __pyx_v_array_parameters = { 0, 0, { 0 }, { 0 }, { 0 } };
5181  double *__pyx_v_c_trace;
5182  double *__pyx_v_c_error;
5183  __pyx_t_5imate_12_definitions_5types_IndexType *__pyx_v_c_processed_samples_indices;
5184  __pyx_t_5imate_12_definitions_5types_IndexType *__pyx_v_c_num_samples_used;
5185  __pyx_t_5imate_12_definitions_5types_IndexType *__pyx_v_c_num_outliers;
5186  __pyx_t_5imate_12_definitions_5types_FlagType *__pyx_v_c_converged;
5187  double **__pyx_v_c_samples;
5188  __pyx_t_5imate_12_definitions_5types_IndexType __pyx_v_i;
5189  __pyx_t_5imate_12_definitions_5types_IndexType __pyx_v_j;
5190  cLinearOperator<double> *__pyx_v_Aop_double;
5191  Function *__pyx_v_matrix_function;
5192  __pyx_t_5imate_12_definitions_5types_FlagType __pyx_v_all_converged;
5193  __pyx_t_5imate_12_definitions_5types_FlagType __pyx_r;
5194  __Pyx_TraceDeclarations
5195  __Pyx_RefNannyDeclarations
5196  int __pyx_t_1;
5197  int __pyx_t_2;
5198  PyObject *__pyx_t_3 = NULL;
5199  PyObject *__pyx_t_4 = NULL;
5200  PyObject *__pyx_t_5 = NULL;
5201  double __pyx_t_6;
5202  __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
5203  Py_ssize_t __pyx_t_8;
5204  __pyx_t_5imate_12_definitions_5types_IndexType __pyx_t_9;
5205  __pyx_t_5imate_12_definitions_5types_IndexType __pyx_t_10;
5206  __pyx_t_5imate_12_definitions_5types_IndexType __pyx_t_11;
5207  __pyx_t_5imate_12_definitions_5types_IndexType __pyx_t_12;
5208  __pyx_t_5imate_12_definitions_5types_IndexType __pyx_t_13;
5209  __pyx_t_5imate_12_definitions_5types_IndexType __pyx_t_14;
5210  cLinearOperator<double> *__pyx_t_15;
5211  int __pyx_t_16;
5212  int __pyx_t_17;
5213  Py_ssize_t __pyx_t_18;
5214  Py_ssize_t __pyx_t_19;
5215  int __pyx_lineno = 0;
5216  const char *__pyx_filename = NULL;
5217  int __pyx_clineno = 0;
5218  __Pyx_RefNannySetupContext("_pyc_trace_estimator_double", 0);
5219  __Pyx_TraceCall("_pyc_trace_estimator_double", __pyx_f[0], 290, 0, __PYX_ERR(0, 290, __pyx_L1_error));
5220 
5221  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":324
5222  * cdef double[:] array_parameters
5223  *
5224  * if parameters is None: # <<<<<<<<<<<<<<
5225  * c_parameters = NULL
5226  *
5227  */
5228  __Pyx_TraceLine(324,0,__PYX_ERR(0, 324, __pyx_L1_error))
5229  __pyx_t_1 = (__pyx_v_parameters == Py_None);
5230  __pyx_t_2 = (__pyx_t_1 != 0);
5231  if (__pyx_t_2) {
5232 
5233  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":325
5234  *
5235  * if parameters is None:
5236  * c_parameters = NULL # <<<<<<<<<<<<<<
5237  *
5238  * elif numpy.isscalar(parameters):
5239  */
5240  __Pyx_TraceLine(325,0,__PYX_ERR(0, 325, __pyx_L1_error))
5241  __pyx_v_c_parameters = NULL;
5242 
5243  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":324
5244  * cdef double[:] array_parameters
5245  *
5246  * if parameters is None: # <<<<<<<<<<<<<<
5247  * c_parameters = NULL
5248  *
5249  */
5250  goto __pyx_L3;
5251  }
5252 
5253  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":327
5254  * c_parameters = NULL
5255  *
5256  * elif numpy.isscalar(parameters): # <<<<<<<<<<<<<<
5257  * scalar_parameters = parameters
5258  * c_parameters = &scalar_parameters
5259  */
5260  __Pyx_TraceLine(327,0,__PYX_ERR(0, 327, __pyx_L1_error))
5261  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 327, __pyx_L1_error)
5262  __Pyx_GOTREF(__pyx_t_4);
5263  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_isscalar); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 327, __pyx_L1_error)
5264  __Pyx_GOTREF(__pyx_t_5);
5265  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5266  __pyx_t_4 = NULL;
5267  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
5268  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
5269  if (likely(__pyx_t_4)) {
5270  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
5271  __Pyx_INCREF(__pyx_t_4);
5272  __Pyx_INCREF(function);
5273  __Pyx_DECREF_SET(__pyx_t_5, function);
5274  }
5275  }
5276  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_v_parameters) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_parameters);
5277  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
5278  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 327, __pyx_L1_error)
5279  __Pyx_GOTREF(__pyx_t_3);
5280  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5281  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 327, __pyx_L1_error)
5282  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5283  if (__pyx_t_2) {
5284 
5285  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":328
5286  *
5287  * elif numpy.isscalar(parameters):
5288  * scalar_parameters = parameters # <<<<<<<<<<<<<<
5289  * c_parameters = &scalar_parameters
5290  *
5291  */
5292  __Pyx_TraceLine(328,0,__PYX_ERR(0, 328, __pyx_L1_error))
5293  __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_parameters); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 328, __pyx_L1_error)
5294  __pyx_v_scalar_parameters = __pyx_t_6;
5295 
5296  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":329
5297  * elif numpy.isscalar(parameters):
5298  * scalar_parameters = parameters
5299  * c_parameters = &scalar_parameters # <<<<<<<<<<<<<<
5300  *
5301  * else:
5302  */
5303  __Pyx_TraceLine(329,0,__PYX_ERR(0, 329, __pyx_L1_error))
5304  __pyx_v_c_parameters = (&__pyx_v_scalar_parameters);
5305 
5306  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":327
5307  * c_parameters = NULL
5308  *
5309  * elif numpy.isscalar(parameters): # <<<<<<<<<<<<<<
5310  * scalar_parameters = parameters
5311  * c_parameters = &scalar_parameters
5312  */
5313  goto __pyx_L3;
5314  }
5315 
5316  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":332
5317  *
5318  * else:
5319  * array_parameters = parameters # <<<<<<<<<<<<<<
5320  * c_parameters = &array_parameters[0]
5321  *
5322  */
5323  __Pyx_TraceLine(332,0,__PYX_ERR(0, 332, __pyx_L1_error))
5324  /*else*/ {
5325  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_parameters, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 332, __pyx_L1_error)
5326  __pyx_v_array_parameters = __pyx_t_7;
5327  __pyx_t_7.memview = NULL;
5328  __pyx_t_7.data = NULL;
5329 
5330  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":333
5331  * else:
5332  * array_parameters = parameters
5333  * c_parameters = &array_parameters[0] # <<<<<<<<<<<<<<
5334  *
5335  * # C pointers from memoryviews
5336  */
5337  __Pyx_TraceLine(333,0,__PYX_ERR(0, 333, __pyx_L1_error))
5338  __pyx_t_8 = 0;
5339  __pyx_v_c_parameters = (&(*((double *) ( /* dim=0 */ (__pyx_v_array_parameters.data + __pyx_t_8 * __pyx_v_array_parameters.strides[0]) ))));
5340  }
5341  __pyx_L3:;
5342 
5343  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":336
5344  *
5345  * # C pointers from memoryviews
5346  * cdef double* c_trace = &trace[0] # <<<<<<<<<<<<<<
5347  * cdef double* c_error = &error[0]
5348  * cdef IndexType* c_processed_samples_indices = &processed_samples_indices[0]
5349  */
5350  __Pyx_TraceLine(336,0,__PYX_ERR(0, 336, __pyx_L1_error))
5351  __pyx_t_8 = 0;
5352  __pyx_v_c_trace = (&(*((double *) ( /* dim=0 */ (__pyx_v_trace.data + __pyx_t_8 * __pyx_v_trace.strides[0]) ))));
5353 
5354  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":337
5355  * # C pointers from memoryviews
5356  * cdef double* c_trace = &trace[0]
5357  * cdef double* c_error = &error[0] # <<<<<<<<<<<<<<
5358  * cdef IndexType* c_processed_samples_indices = &processed_samples_indices[0]
5359  * cdef IndexType* c_num_samples_used = &num_samples_used[0]
5360  */
5361  __Pyx_TraceLine(337,0,__PYX_ERR(0, 337, __pyx_L1_error))
5362  __pyx_t_8 = 0;
5363  __pyx_v_c_error = (&(*((double *) ( /* dim=0 */ (__pyx_v_error.data + __pyx_t_8 * __pyx_v_error.strides[0]) ))));
5364 
5365  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":338
5366  * cdef double* c_trace = &trace[0]
5367  * cdef double* c_error = &error[0]
5368  * cdef IndexType* c_processed_samples_indices = &processed_samples_indices[0] # <<<<<<<<<<<<<<
5369  * cdef IndexType* c_num_samples_used = &num_samples_used[0]
5370  * cdef IndexType* c_num_outliers = &num_outliers[0]
5371  */
5372  __Pyx_TraceLine(338,0,__PYX_ERR(0, 338, __pyx_L1_error))
5373  __pyx_t_8 = 0;
5374  __pyx_v_c_processed_samples_indices = (&(*((int *) ( /* dim=0 */ (__pyx_v_processed_samples_indices.data + __pyx_t_8 * __pyx_v_processed_samples_indices.strides[0]) ))));
5375 
5376  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":339
5377  * cdef double* c_error = &error[0]
5378  * cdef IndexType* c_processed_samples_indices = &processed_samples_indices[0]
5379  * cdef IndexType* c_num_samples_used = &num_samples_used[0] # <<<<<<<<<<<<<<
5380  * cdef IndexType* c_num_outliers = &num_outliers[0]
5381  * cdef FlagType* c_converged = &converged[0]
5382  */
5383  __Pyx_TraceLine(339,0,__PYX_ERR(0, 339, __pyx_L1_error))
5384  __pyx_t_8 = 0;
5385  __pyx_v_c_num_samples_used = (&(*((int *) ( /* dim=0 */ (__pyx_v_num_samples_used.data + __pyx_t_8 * __pyx_v_num_samples_used.strides[0]) ))));
5386 
5387  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":340
5388  * cdef IndexType* c_processed_samples_indices = &processed_samples_indices[0]
5389  * cdef IndexType* c_num_samples_used = &num_samples_used[0]
5390  * cdef IndexType* c_num_outliers = &num_outliers[0] # <<<<<<<<<<<<<<
5391  * cdef FlagType* c_converged = &converged[0]
5392  *
5393  */
5394  __Pyx_TraceLine(340,0,__PYX_ERR(0, 340, __pyx_L1_error))
5395  __pyx_t_8 = 0;
5396  __pyx_v_c_num_outliers = (&(*((int *) ( /* dim=0 */ (__pyx_v_num_outliers.data + __pyx_t_8 * __pyx_v_num_outliers.strides[0]) ))));
5397 
5398  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":341
5399  * cdef IndexType* c_num_samples_used = &num_samples_used[0]
5400  * cdef IndexType* c_num_outliers = &num_outliers[0]
5401  * cdef FlagType* c_converged = &converged[0] # <<<<<<<<<<<<<<
5402  *
5403  * # For samples array, instead of memoryview, allocate a 2D C array
5404  */
5405  __Pyx_TraceLine(341,0,__PYX_ERR(0, 341, __pyx_L1_error))
5406  __pyx_t_8 = 0;
5407  __pyx_v_c_converged = (&(*((int *) ( /* dim=0 */ (__pyx_v_converged.data + __pyx_t_8 * __pyx_v_converged.strides[0]) ))));
5408 
5409  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":345
5410  * # For samples array, instead of memoryview, allocate a 2D C array
5411  * cdef double** c_samples = \
5412  * <double**> malloc(sizeof(double) * max_num_samples) # <<<<<<<<<<<<<<
5413  * cdef IndexType i, j
5414  * for i in range(max_num_samples):
5415  */
5416  __Pyx_TraceLine(345,0,__PYX_ERR(0, 345, __pyx_L1_error))
5417  __pyx_v_c_samples = ((double **)malloc(((sizeof(double)) * __pyx_v_max_num_samples)));
5418 
5419  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":347
5420  * <double**> malloc(sizeof(double) * max_num_samples)
5421  * cdef IndexType i, j
5422  * for i in range(max_num_samples): # <<<<<<<<<<<<<<
5423  * c_samples[i] = <double*> malloc(sizeof(double*) * num_inquiries)
5424  *
5425  */
5426  __Pyx_TraceLine(347,0,__PYX_ERR(0, 347, __pyx_L1_error))
5427  __pyx_t_9 = __pyx_v_max_num_samples;
5428  __pyx_t_10 = __pyx_t_9;
5429  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
5430  __pyx_v_i = __pyx_t_11;
5431 
5432  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":348
5433  * cdef IndexType i, j
5434  * for i in range(max_num_samples):
5435  * c_samples[i] = <double*> malloc(sizeof(double*) * num_inquiries) # <<<<<<<<<<<<<<
5436  *
5437  * for j in range(num_inquiries):
5438  */
5439  __Pyx_TraceLine(348,0,__PYX_ERR(0, 348, __pyx_L1_error))
5440  (__pyx_v_c_samples[__pyx_v_i]) = ((double *)malloc(((sizeof(double *)) * __pyx_v_num_inquiries)));
5441 
5442  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":350
5443  * c_samples[i] = <double*> malloc(sizeof(double*) * num_inquiries)
5444  *
5445  * for j in range(num_inquiries): # <<<<<<<<<<<<<<
5446  * c_samples[i][j] = NAN
5447  *
5448  */
5449  __Pyx_TraceLine(350,0,__PYX_ERR(0, 350, __pyx_L1_error))
5450  __pyx_t_12 = __pyx_v_num_inquiries;
5451  __pyx_t_13 = __pyx_t_12;
5452  for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
5453  __pyx_v_j = __pyx_t_14;
5454 
5455  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":351
5456  *
5457  * for j in range(num_inquiries):
5458  * c_samples[i][j] = NAN # <<<<<<<<<<<<<<
5459  *
5460  * # Get cLinearOperator
5461  */
5462  __Pyx_TraceLine(351,0,__PYX_ERR(0, 351, __pyx_L1_error))
5463  ((__pyx_v_c_samples[__pyx_v_i])[__pyx_v_j]) = NAN;
5464  }
5465  }
5466 
5467  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":354
5468  *
5469  * # Get cLinearOperator
5470  * cdef cLinearOperator[double]* Aop_double = Aop.get_linear_operator_double() # <<<<<<<<<<<<<<
5471  *
5472  * cdef Function* matrix_function = py_matrix_function.get_function()
5473  */
5474  __Pyx_TraceLine(354,0,__PYX_ERR(0, 354, __pyx_L1_error))
5475  __pyx_t_15 = ((struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *)__pyx_v_Aop->__pyx_vtab)->get_linear_operator_double(__pyx_v_Aop); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 354, __pyx_L1_error)
5476  __pyx_v_Aop_double = __pyx_t_15;
5477 
5478  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":356
5479  * cdef cLinearOperator[double]* Aop_double = Aop.get_linear_operator_double()
5480  *
5481  * cdef Function* matrix_function = py_matrix_function.get_function() # <<<<<<<<<<<<<<
5482  *
5483  * # Call templated c++ module
5484  */
5485  __Pyx_TraceLine(356,0,__PYX_ERR(0, 356, __pyx_L1_error))
5486  __pyx_v_matrix_function = ((struct __pyx_vtabstruct_5imate_9functions_12py_functions_pyFunction *)__pyx_v_py_matrix_function->__pyx_vtab)->get_function(__pyx_v_py_matrix_function);
5487 
5488  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":360
5489  * # Call templated c++ module
5490  * cdef FlagType all_converged = \
5491  * cTraceEstimator[double].c_trace_estimator( # <<<<<<<<<<<<<<
5492  * Aop_double,
5493  * c_parameters,
5494  */
5495  __Pyx_TraceLine(360,0,__PYX_ERR(0, 360, __pyx_L1_error))
5496  __pyx_v_all_converged = cTraceEstimator<double> ::c_trace_estimator(__pyx_v_Aop_double, __pyx_v_c_parameters, __pyx_v_num_inquiries, __pyx_v_matrix_function, __pyx_v_gram, __pyx_v_exponent, __pyx_v_reorthogonalize, __pyx_v_seed, __pyx_v_lanczos_degree, __pyx_v_lanczos_tol, __pyx_v_min_num_samples, __pyx_v_max_num_samples, __pyx_v_error_atol, __pyx_v_error_rtol, __pyx_v_confidence_level, __pyx_v_outlier_significance_level, __pyx_v_num_threads, __pyx_v_c_trace, __pyx_v_c_error, __pyx_v_c_samples, __pyx_v_c_processed_samples_indices, __pyx_v_c_num_samples_used, __pyx_v_c_num_outliers, __pyx_v_c_converged, __pyx_v_alg_wall_time);
5497 
5498  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":389
5499  * # Write the processed samples to samples to a numpy array. The unprocessed
5500  * # elements of samples array is nan.
5501  * for j in range(num_inquiries): # <<<<<<<<<<<<<<
5502  * for i in range(num_samples_used[j]):
5503  * samples[i, j] = c_samples[processed_samples_indices[i]][j]
5504  */
5505  __Pyx_TraceLine(389,0,__PYX_ERR(0, 389, __pyx_L1_error))
5506  __pyx_t_9 = __pyx_v_num_inquiries;
5507  __pyx_t_10 = __pyx_t_9;
5508  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
5509  __pyx_v_j = __pyx_t_11;
5510 
5511  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":390
5512  * # elements of samples array is nan.
5513  * for j in range(num_inquiries):
5514  * for i in range(num_samples_used[j]): # <<<<<<<<<<<<<<
5515  * samples[i, j] = c_samples[processed_samples_indices[i]][j]
5516  * # for i in range(max_num_samples):
5517  */
5518  __Pyx_TraceLine(390,0,__PYX_ERR(0, 390, __pyx_L1_error))
5519  __pyx_t_8 = __pyx_v_j;
5520  __pyx_t_16 = (*((int *) ( /* dim=0 */ (__pyx_v_num_samples_used.data + __pyx_t_8 * __pyx_v_num_samples_used.strides[0]) )));
5521  __pyx_t_17 = __pyx_t_16;
5522  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_17; __pyx_t_12+=1) {
5523  __pyx_v_i = __pyx_t_12;
5524 
5525  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":391
5526  * for j in range(num_inquiries):
5527  * for i in range(num_samples_used[j]):
5528  * samples[i, j] = c_samples[processed_samples_indices[i]][j] # <<<<<<<<<<<<<<
5529  * # for i in range(max_num_samples):
5530  * # samples[i, j] = c_samples[i][j]
5531  */
5532  __Pyx_TraceLine(391,0,__PYX_ERR(0, 391, __pyx_L1_error))
5533  __pyx_t_8 = __pyx_v_i;
5534  __pyx_t_18 = __pyx_v_i;
5535  __pyx_t_19 = __pyx_v_j;
5536  *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_samples.data + __pyx_t_18 * __pyx_v_samples.strides[0]) )) + __pyx_t_19)) )) = ((__pyx_v_c_samples[(*((int *) ( /* dim=0 */ (__pyx_v_processed_samples_indices.data + __pyx_t_8 * __pyx_v_processed_samples_indices.strides[0]) )))])[__pyx_v_j]);
5537  }
5538  }
5539 
5540  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":396
5541  *
5542  * # Deallocate dynamic memory
5543  * for i in range(max_num_samples): # <<<<<<<<<<<<<<
5544  * free(c_samples[i])
5545  * free(c_samples)
5546  */
5547  __Pyx_TraceLine(396,0,__PYX_ERR(0, 396, __pyx_L1_error))
5548  __pyx_t_9 = __pyx_v_max_num_samples;
5549  __pyx_t_10 = __pyx_t_9;
5550  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
5551  __pyx_v_i = __pyx_t_11;
5552 
5553  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":397
5554  * # Deallocate dynamic memory
5555  * for i in range(max_num_samples):
5556  * free(c_samples[i]) # <<<<<<<<<<<<<<
5557  * free(c_samples)
5558  *
5559  */
5560  __Pyx_TraceLine(397,0,__PYX_ERR(0, 397, __pyx_L1_error))
5561  free((__pyx_v_c_samples[__pyx_v_i]));
5562  }
5563 
5564  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":398
5565  * for i in range(max_num_samples):
5566  * free(c_samples[i])
5567  * free(c_samples) # <<<<<<<<<<<<<<
5568  *
5569  * return all_converged
5570  */
5571  __Pyx_TraceLine(398,0,__PYX_ERR(0, 398, __pyx_L1_error))
5572  free(__pyx_v_c_samples);
5573 
5574  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":400
5575  * free(c_samples)
5576  *
5577  * return all_converged # <<<<<<<<<<<<<<
5578  *
5579  *
5580  */
5581  __Pyx_TraceLine(400,0,__PYX_ERR(0, 400, __pyx_L1_error))
5582  __pyx_r = __pyx_v_all_converged;
5583  goto __pyx_L0;
5584 
5585  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":290
5586  * # ==========================
5587  *
5588  * cdef FlagType _pyc_trace_estimator_double( # <<<<<<<<<<<<<<
5589  * pycLinearOperator Aop,
5590  * parameters,
5591  */
5592 
5593  /* function exit code */
5594  __pyx_L1_error:;
5595  __Pyx_XDECREF(__pyx_t_3);
5596  __Pyx_XDECREF(__pyx_t_4);
5597  __Pyx_XDECREF(__pyx_t_5);
5598  __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
5599  __Pyx_AddTraceback("imate._c_trace_estimator.py_c_trace_estimator._pyc_trace_estimator_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
5600  __pyx_r = -1;
5601  __pyx_L0:;
5602  __PYX_XDEC_MEMVIEW(&__pyx_v_array_parameters, 1);
5603  __Pyx_TraceReturn(Py_None, 0);
5604  __Pyx_RefNannyFinishContext();
5605  return __pyx_r;
5606 }
5607 
5608 /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":407
5609  * # ===============================
5610  *
5611  * cdef FlagType _pyc_trace_estimator_long_double( # <<<<<<<<<<<<<<
5612  * pycLinearOperator Aop,
5613  * parameters,
5614  */
5615 
5616 static __pyx_t_5imate_12_definitions_5types_FlagType __pyx_f_5imate_18_c_trace_estimator_20py_c_trace_estimator__pyc_trace_estimator_long_double(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_Aop, PyObject *__pyx_v_parameters, __pyx_t_5imate_12_definitions_5types_IndexType const __pyx_v_num_inquiries, struct __pyx_obj_5imate_9functions_12py_functions_pyFunction *__pyx_v_py_matrix_function, __pyx_t_5imate_12_definitions_5types_FlagType const __pyx_v_gram, long double const __pyx_v_exponent, __pyx_t_5imate_12_definitions_5types_FlagType const __pyx_v_reorthogonalize, int64_t const __pyx_v_seed, __pyx_t_5imate_12_definitions_5types_IndexType const __pyx_v_lanczos_degree, long double const __pyx_v_lanczos_tol, __pyx_t_5imate_12_definitions_5types_IndexType const __pyx_v_min_num_samples, __pyx_t_5imate_12_definitions_5types_IndexType const __pyx_v_max_num_samples, long double const __pyx_v_error_atol, long double const __pyx_v_error_rtol, long double const __pyx_v_confidence_level, long double const __pyx_v_outlier_significance_level, __pyx_t_5imate_12_definitions_5types_IndexType const __pyx_v_num_threads, __Pyx_memviewslice __pyx_v_trace, __Pyx_memviewslice __pyx_v_error, __Pyx_memviewslice __pyx_v_samples, __pyx_t_5imate_12_definitions_5types_MemoryViewIndexType __pyx_v_processed_samples_indices, __pyx_t_5imate_12_definitions_5types_MemoryViewIndexType __pyx_v_num_samples_used, __pyx_t_5imate_12_definitions_5types_MemoryViewIndexType __pyx_v_num_outliers, __pyx_t_5imate_12_definitions_5types_MemoryViewFlagType __pyx_v_converged, float &__pyx_v_alg_wall_time) {
5617  long double *__pyx_v_c_parameters;
5618  long double __pyx_v_scalar_parameters;
5619  __Pyx_memviewslice __pyx_v_array_parameters = { 0, 0, { 0 }, { 0 }, { 0 } };
5620  long double *__pyx_v_c_trace;
5621  long double *__pyx_v_c_error;
5622  __pyx_t_5imate_12_definitions_5types_IndexType *__pyx_v_c_processed_samples_indices;
5623  __pyx_t_5imate_12_definitions_5types_IndexType *__pyx_v_c_num_samples_used;
5624  __pyx_t_5imate_12_definitions_5types_IndexType *__pyx_v_c_num_outliers;
5625  __pyx_t_5imate_12_definitions_5types_FlagType *__pyx_v_c_converged;
5626  long double **__pyx_v_c_samples;
5627  __pyx_t_5imate_12_definitions_5types_IndexType __pyx_v_i;
5628  __pyx_t_5imate_12_definitions_5types_IndexType __pyx_v_j;
5629  cLinearOperator<long double> *__pyx_v_Aop_long_double;
5630  Function *__pyx_v_matrix_function;
5631  __pyx_t_5imate_12_definitions_5types_FlagType __pyx_v_all_converged;
5632  __pyx_t_5imate_12_definitions_5types_FlagType __pyx_r;
5633  __Pyx_TraceDeclarations
5634  __Pyx_RefNannyDeclarations
5635  int __pyx_t_1;
5636  int __pyx_t_2;
5637  PyObject *__pyx_t_3 = NULL;
5638  PyObject *__pyx_t_4 = NULL;
5639  PyObject *__pyx_t_5 = NULL;
5640  long double __pyx_t_6;
5641  __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
5642  Py_ssize_t __pyx_t_8;
5643  __pyx_t_5imate_12_definitions_5types_IndexType __pyx_t_9;
5644  __pyx_t_5imate_12_definitions_5types_IndexType __pyx_t_10;
5645  __pyx_t_5imate_12_definitions_5types_IndexType __pyx_t_11;
5646  __pyx_t_5imate_12_definitions_5types_IndexType __pyx_t_12;
5647  __pyx_t_5imate_12_definitions_5types_IndexType __pyx_t_13;
5648  __pyx_t_5imate_12_definitions_5types_IndexType __pyx_t_14;
5649  cLinearOperator<long double> *__pyx_t_15;
5650  int __pyx_t_16;
5651  int __pyx_t_17;
5652  Py_ssize_t __pyx_t_18;
5653  Py_ssize_t __pyx_t_19;
5654  int __pyx_lineno = 0;
5655  const char *__pyx_filename = NULL;
5656  int __pyx_clineno = 0;
5657  __Pyx_RefNannySetupContext("_pyc_trace_estimator_long_double", 0);
5658  __Pyx_TraceCall("_pyc_trace_estimator_long_double", __pyx_f[0], 407, 0, __PYX_ERR(0, 407, __pyx_L1_error));
5659 
5660  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":441
5661  * cdef long double[:] array_parameters
5662  *
5663  * if parameters is None: # <<<<<<<<<<<<<<
5664  * c_parameters = NULL
5665  *
5666  */
5667  __Pyx_TraceLine(441,0,__PYX_ERR(0, 441, __pyx_L1_error))
5668  __pyx_t_1 = (__pyx_v_parameters == Py_None);
5669  __pyx_t_2 = (__pyx_t_1 != 0);
5670  if (__pyx_t_2) {
5671 
5672  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":442
5673  *
5674  * if parameters is None:
5675  * c_parameters = NULL # <<<<<<<<<<<<<<
5676  *
5677  * elif numpy.isscalar(parameters):
5678  */
5679  __Pyx_TraceLine(442,0,__PYX_ERR(0, 442, __pyx_L1_error))
5680  __pyx_v_c_parameters = NULL;
5681 
5682  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":441
5683  * cdef long double[:] array_parameters
5684  *
5685  * if parameters is None: # <<<<<<<<<<<<<<
5686  * c_parameters = NULL
5687  *
5688  */
5689  goto __pyx_L3;
5690  }
5691 
5692  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":444
5693  * c_parameters = NULL
5694  *
5695  * elif numpy.isscalar(parameters): # <<<<<<<<<<<<<<
5696  * scalar_parameters = parameters
5697  * c_parameters = &scalar_parameters
5698  */
5699  __Pyx_TraceLine(444,0,__PYX_ERR(0, 444, __pyx_L1_error))
5700  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 444, __pyx_L1_error)
5701  __Pyx_GOTREF(__pyx_t_4);
5702  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_isscalar); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 444, __pyx_L1_error)
5703  __Pyx_GOTREF(__pyx_t_5);
5704  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5705  __pyx_t_4 = NULL;
5706  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
5707  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
5708  if (likely(__pyx_t_4)) {
5709  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
5710  __Pyx_INCREF(__pyx_t_4);
5711  __Pyx_INCREF(function);
5712  __Pyx_DECREF_SET(__pyx_t_5, function);
5713  }
5714  }
5715  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_v_parameters) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_parameters);
5716  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
5717  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 444, __pyx_L1_error)
5718  __Pyx_GOTREF(__pyx_t_3);
5719  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5720  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 444, __pyx_L1_error)
5721  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5722  if (__pyx_t_2) {
5723 
5724  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":445
5725  *
5726  * elif numpy.isscalar(parameters):
5727  * scalar_parameters = parameters # <<<<<<<<<<<<<<
5728  * c_parameters = &scalar_parameters
5729  *
5730  */
5731  __Pyx_TraceLine(445,0,__PYX_ERR(0, 445, __pyx_L1_error))
5732  __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_parameters); if (unlikely((__pyx_t_6 == (long double)-1) && PyErr_Occurred())) __PYX_ERR(0, 445, __pyx_L1_error)
5733  __pyx_v_scalar_parameters = __pyx_t_6;
5734 
5735  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":446
5736  * elif numpy.isscalar(parameters):
5737  * scalar_parameters = parameters
5738  * c_parameters = &scalar_parameters # <<<<<<<<<<<<<<
5739  *
5740  * else:
5741  */
5742  __Pyx_TraceLine(446,0,__PYX_ERR(0, 446, __pyx_L1_error))
5743  __pyx_v_c_parameters = (&__pyx_v_scalar_parameters);
5744 
5745  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":444
5746  * c_parameters = NULL
5747  *
5748  * elif numpy.isscalar(parameters): # <<<<<<<<<<<<<<
5749  * scalar_parameters = parameters
5750  * c_parameters = &scalar_parameters
5751  */
5752  goto __pyx_L3;
5753  }
5754 
5755  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":449
5756  *
5757  * else:
5758  * array_parameters = parameters # <<<<<<<<<<<<<<
5759  * c_parameters = &array_parameters[0]
5760  *
5761  */
5762  __Pyx_TraceLine(449,0,__PYX_ERR(0, 449, __pyx_L1_error))
5763  /*else*/ {
5764  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(__pyx_v_parameters, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 449, __pyx_L1_error)
5765  __pyx_v_array_parameters = __pyx_t_7;
5766  __pyx_t_7.memview = NULL;
5767  __pyx_t_7.data = NULL;
5768 
5769  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":450
5770  * else:
5771  * array_parameters = parameters
5772  * c_parameters = &array_parameters[0] # <<<<<<<<<<<<<<
5773  *
5774  * # C pointers from memoryviews
5775  */
5776  __Pyx_TraceLine(450,0,__PYX_ERR(0, 450, __pyx_L1_error))
5777  __pyx_t_8 = 0;
5778  __pyx_v_c_parameters = (&(*((long double *) ( /* dim=0 */ (__pyx_v_array_parameters.data + __pyx_t_8 * __pyx_v_array_parameters.strides[0]) ))));
5779  }
5780  __pyx_L3:;
5781 
5782  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":453
5783  *
5784  * # C pointers from memoryviews
5785  * cdef long double* c_trace = &trace[0] # <<<<<<<<<<<<<<
5786  * cdef long double* c_error = &error[0]
5787  * cdef IndexType* c_processed_samples_indices = &processed_samples_indices[0]
5788  */
5789  __Pyx_TraceLine(453,0,__PYX_ERR(0, 453, __pyx_L1_error))
5790  __pyx_t_8 = 0;
5791  __pyx_v_c_trace = (&(*((long double *) ( /* dim=0 */ (__pyx_v_trace.data + __pyx_t_8 * __pyx_v_trace.strides[0]) ))));
5792 
5793  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":454
5794  * # C pointers from memoryviews
5795  * cdef long double* c_trace = &trace[0]
5796  * cdef long double* c_error = &error[0] # <<<<<<<<<<<<<<
5797  * cdef IndexType* c_processed_samples_indices = &processed_samples_indices[0]
5798  * cdef IndexType* c_num_samples_used = &num_samples_used[0]
5799  */
5800  __Pyx_TraceLine(454,0,__PYX_ERR(0, 454, __pyx_L1_error))
5801  __pyx_t_8 = 0;
5802  __pyx_v_c_error = (&(*((long double *) ( /* dim=0 */ (__pyx_v_error.data + __pyx_t_8 * __pyx_v_error.strides[0]) ))));
5803 
5804  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":455
5805  * cdef long double* c_trace = &trace[0]
5806  * cdef long double* c_error = &error[0]
5807  * cdef IndexType* c_processed_samples_indices = &processed_samples_indices[0] # <<<<<<<<<<<<<<
5808  * cdef IndexType* c_num_samples_used = &num_samples_used[0]
5809  * cdef IndexType* c_num_outliers = &num_outliers[0]
5810  */
5811  __Pyx_TraceLine(455,0,__PYX_ERR(0, 455, __pyx_L1_error))
5812  __pyx_t_8 = 0;
5813  __pyx_v_c_processed_samples_indices = (&(*((int *) ( /* dim=0 */ (__pyx_v_processed_samples_indices.data + __pyx_t_8 * __pyx_v_processed_samples_indices.strides[0]) ))));
5814 
5815  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":456
5816  * cdef long double* c_error = &error[0]
5817  * cdef IndexType* c_processed_samples_indices = &processed_samples_indices[0]
5818  * cdef IndexType* c_num_samples_used = &num_samples_used[0] # <<<<<<<<<<<<<<
5819  * cdef IndexType* c_num_outliers = &num_outliers[0]
5820  * cdef FlagType* c_converged = &converged[0]
5821  */
5822  __Pyx_TraceLine(456,0,__PYX_ERR(0, 456, __pyx_L1_error))
5823  __pyx_t_8 = 0;
5824  __pyx_v_c_num_samples_used = (&(*((int *) ( /* dim=0 */ (__pyx_v_num_samples_used.data + __pyx_t_8 * __pyx_v_num_samples_used.strides[0]) ))));
5825 
5826  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":457
5827  * cdef IndexType* c_processed_samples_indices = &processed_samples_indices[0]
5828  * cdef IndexType* c_num_samples_used = &num_samples_used[0]
5829  * cdef IndexType* c_num_outliers = &num_outliers[0] # <<<<<<<<<<<<<<
5830  * cdef FlagType* c_converged = &converged[0]
5831  *
5832  */
5833  __Pyx_TraceLine(457,0,__PYX_ERR(0, 457, __pyx_L1_error))
5834  __pyx_t_8 = 0;
5835  __pyx_v_c_num_outliers = (&(*((int *) ( /* dim=0 */ (__pyx_v_num_outliers.data + __pyx_t_8 * __pyx_v_num_outliers.strides[0]) ))));
5836 
5837  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":458
5838  * cdef IndexType* c_num_samples_used = &num_samples_used[0]
5839  * cdef IndexType* c_num_outliers = &num_outliers[0]
5840  * cdef FlagType* c_converged = &converged[0] # <<<<<<<<<<<<<<
5841  *
5842  * # For samples array, instead of memoryview, allocate a 2D C array
5843  */
5844  __Pyx_TraceLine(458,0,__PYX_ERR(0, 458, __pyx_L1_error))
5845  __pyx_t_8 = 0;
5846  __pyx_v_c_converged = (&(*((int *) ( /* dim=0 */ (__pyx_v_converged.data + __pyx_t_8 * __pyx_v_converged.strides[0]) ))));
5847 
5848  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":462
5849  * # For samples array, instead of memoryview, allocate a 2D C array
5850  * cdef long double** c_samples = \
5851  * <long double**> malloc(sizeof(long double*) * max_num_samples) # <<<<<<<<<<<<<<
5852  * cdef IndexType i, j
5853  * for i in range(max_num_samples):
5854  */
5855  __Pyx_TraceLine(462,0,__PYX_ERR(0, 462, __pyx_L1_error))
5856  __pyx_v_c_samples = ((long double **)malloc(((sizeof(long double *)) * __pyx_v_max_num_samples)));
5857 
5858  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":464
5859  * <long double**> malloc(sizeof(long double*) * max_num_samples)
5860  * cdef IndexType i, j
5861  * for i in range(max_num_samples): # <<<<<<<<<<<<<<
5862  * c_samples[i] = \
5863  * <long double*> malloc(sizeof(long double) * num_inquiries)
5864  */
5865  __Pyx_TraceLine(464,0,__PYX_ERR(0, 464, __pyx_L1_error))
5866  __pyx_t_9 = __pyx_v_max_num_samples;
5867  __pyx_t_10 = __pyx_t_9;
5868  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
5869  __pyx_v_i = __pyx_t_11;
5870 
5871  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":465
5872  * cdef IndexType i, j
5873  * for i in range(max_num_samples):
5874  * c_samples[i] = \ # <<<<<<<<<<<<<<
5875  * <long double*> malloc(sizeof(long double) * num_inquiries)
5876  *
5877  */
5878  __Pyx_TraceLine(465,0,__PYX_ERR(0, 465, __pyx_L1_error))
5879  (__pyx_v_c_samples[__pyx_v_i]) = ((long double *)malloc(((sizeof(long double)) * __pyx_v_num_inquiries)));
5880 
5881  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":468
5882  * <long double*> malloc(sizeof(long double) * num_inquiries)
5883  *
5884  * for j in range(num_inquiries): # <<<<<<<<<<<<<<
5885  * c_samples[i][j] = NAN
5886  *
5887  */
5888  __Pyx_TraceLine(468,0,__PYX_ERR(0, 468, __pyx_L1_error))
5889  __pyx_t_12 = __pyx_v_num_inquiries;
5890  __pyx_t_13 = __pyx_t_12;
5891  for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
5892  __pyx_v_j = __pyx_t_14;
5893 
5894  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":469
5895  *
5896  * for j in range(num_inquiries):
5897  * c_samples[i][j] = NAN # <<<<<<<<<<<<<<
5898  *
5899  * # Get cLinearOperator
5900  */
5901  __Pyx_TraceLine(469,0,__PYX_ERR(0, 469, __pyx_L1_error))
5902  ((__pyx_v_c_samples[__pyx_v_i])[__pyx_v_j]) = NAN;
5903  }
5904  }
5905 
5906  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":473
5907  * # Get cLinearOperator
5908  * cdef cLinearOperator[long double]* Aop_long_double = \
5909  * Aop.get_linear_operator_long_double() # <<<<<<<<<<<<<<
5910  *
5911  * cdef Function* matrix_function = py_matrix_function.get_function()
5912  */
5913  __Pyx_TraceLine(473,0,__PYX_ERR(0, 473, __pyx_L1_error))
5914  __pyx_t_15 = ((struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *)__pyx_v_Aop->__pyx_vtab)->get_linear_operator_long_double(__pyx_v_Aop); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 473, __pyx_L1_error)
5915  __pyx_v_Aop_long_double = __pyx_t_15;
5916 
5917  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":475
5918  * Aop.get_linear_operator_long_double()
5919  *
5920  * cdef Function* matrix_function = py_matrix_function.get_function() # <<<<<<<<<<<<<<
5921  *
5922  * # Call templated c++ module
5923  */
5924  __Pyx_TraceLine(475,0,__PYX_ERR(0, 475, __pyx_L1_error))
5925  __pyx_v_matrix_function = ((struct __pyx_vtabstruct_5imate_9functions_12py_functions_pyFunction *)__pyx_v_py_matrix_function->__pyx_vtab)->get_function(__pyx_v_py_matrix_function);
5926 
5927  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":479
5928  * # Call templated c++ module
5929  * cdef FlagType all_converged = \
5930  * cTraceEstimator[long_double].c_trace_estimator( # <<<<<<<<<<<<<<
5931  * Aop_long_double,
5932  * c_parameters,
5933  */
5934  __Pyx_TraceLine(479,0,__PYX_ERR(0, 479, __pyx_L1_error))
5935  __pyx_v_all_converged = cTraceEstimator<__pyx_t_5imate_18_c_trace_estimator_20py_c_trace_estimator_long_double> ::c_trace_estimator(__pyx_v_Aop_long_double, __pyx_v_c_parameters, __pyx_v_num_inquiries, __pyx_v_matrix_function, __pyx_v_gram, __pyx_v_exponent, __pyx_v_reorthogonalize, __pyx_v_seed, __pyx_v_lanczos_degree, __pyx_v_lanczos_tol, __pyx_v_min_num_samples, __pyx_v_max_num_samples, __pyx_v_error_atol, __pyx_v_error_rtol, __pyx_v_confidence_level, __pyx_v_outlier_significance_level, __pyx_v_num_threads, __pyx_v_c_trace, __pyx_v_c_error, __pyx_v_c_samples, __pyx_v_c_processed_samples_indices, __pyx_v_c_num_samples_used, __pyx_v_c_num_outliers, __pyx_v_c_converged, __pyx_v_alg_wall_time);
5936 
5937  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":508
5938  * # Write the processed samples to samples to a numpy array. The unprocessed
5939  * # elements of samples array is nan.
5940  * for j in range(num_inquiries): # <<<<<<<<<<<<<<
5941  * for i in range(num_samples_used[j]):
5942  * samples[i, j] = c_samples[processed_samples_indices[i]][j]
5943  */
5944  __Pyx_TraceLine(508,0,__PYX_ERR(0, 508, __pyx_L1_error))
5945  __pyx_t_9 = __pyx_v_num_inquiries;
5946  __pyx_t_10 = __pyx_t_9;
5947  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
5948  __pyx_v_j = __pyx_t_11;
5949 
5950  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":509
5951  * # elements of samples array is nan.
5952  * for j in range(num_inquiries):
5953  * for i in range(num_samples_used[j]): # <<<<<<<<<<<<<<
5954  * samples[i, j] = c_samples[processed_samples_indices[i]][j]
5955  * # for i in range(max_num_samples):
5956  */
5957  __Pyx_TraceLine(509,0,__PYX_ERR(0, 509, __pyx_L1_error))
5958  __pyx_t_8 = __pyx_v_j;
5959  __pyx_t_16 = (*((int *) ( /* dim=0 */ (__pyx_v_num_samples_used.data + __pyx_t_8 * __pyx_v_num_samples_used.strides[0]) )));
5960  __pyx_t_17 = __pyx_t_16;
5961  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_17; __pyx_t_12+=1) {
5962  __pyx_v_i = __pyx_t_12;
5963 
5964  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":510
5965  * for j in range(num_inquiries):
5966  * for i in range(num_samples_used[j]):
5967  * samples[i, j] = c_samples[processed_samples_indices[i]][j] # <<<<<<<<<<<<<<
5968  * # for i in range(max_num_samples):
5969  * # samples[i, j] = c_samples[i][j]
5970  */
5971  __Pyx_TraceLine(510,0,__PYX_ERR(0, 510, __pyx_L1_error))
5972  __pyx_t_8 = __pyx_v_i;
5973  __pyx_t_18 = __pyx_v_i;
5974  __pyx_t_19 = __pyx_v_j;
5975  *((long double *) ( /* dim=1 */ ((char *) (((long double *) ( /* dim=0 */ (__pyx_v_samples.data + __pyx_t_18 * __pyx_v_samples.strides[0]) )) + __pyx_t_19)) )) = ((__pyx_v_c_samples[(*((int *) ( /* dim=0 */ (__pyx_v_processed_samples_indices.data + __pyx_t_8 * __pyx_v_processed_samples_indices.strides[0]) )))])[__pyx_v_j]);
5976  }
5977  }
5978 
5979  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":515
5980  *
5981  * # Deallocate dynamic memory
5982  * for i in range(max_num_samples): # <<<<<<<<<<<<<<
5983  * free(c_samples[i])
5984  * free(c_samples)
5985  */
5986  __Pyx_TraceLine(515,0,__PYX_ERR(0, 515, __pyx_L1_error))
5987  __pyx_t_9 = __pyx_v_max_num_samples;
5988  __pyx_t_10 = __pyx_t_9;
5989  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
5990  __pyx_v_i = __pyx_t_11;
5991 
5992  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":516
5993  * # Deallocate dynamic memory
5994  * for i in range(max_num_samples):
5995  * free(c_samples[i]) # <<<<<<<<<<<<<<
5996  * free(c_samples)
5997  *
5998  */
5999  __Pyx_TraceLine(516,0,__PYX_ERR(0, 516, __pyx_L1_error))
6000  free((__pyx_v_c_samples[__pyx_v_i]));
6001  }
6002 
6003  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":517
6004  * for i in range(max_num_samples):
6005  * free(c_samples[i])
6006  * free(c_samples) # <<<<<<<<<<<<<<
6007  *
6008  * return all_converged
6009  */
6010  __Pyx_TraceLine(517,0,__PYX_ERR(0, 517, __pyx_L1_error))
6011  free(__pyx_v_c_samples);
6012 
6013  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":519
6014  * free(c_samples)
6015  *
6016  * return all_converged # <<<<<<<<<<<<<<
6017  */
6018  __Pyx_TraceLine(519,0,__PYX_ERR(0, 519, __pyx_L1_error))
6019  __pyx_r = __pyx_v_all_converged;
6020  goto __pyx_L0;
6021 
6022  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":407
6023  * # ===============================
6024  *
6025  * cdef FlagType _pyc_trace_estimator_long_double( # <<<<<<<<<<<<<<
6026  * pycLinearOperator Aop,
6027  * parameters,
6028  */
6029 
6030  /* function exit code */
6031  __pyx_L1_error:;
6032  __Pyx_XDECREF(__pyx_t_3);
6033  __Pyx_XDECREF(__pyx_t_4);
6034  __Pyx_XDECREF(__pyx_t_5);
6035  __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
6036  __Pyx_AddTraceback("imate._c_trace_estimator.py_c_trace_estimator._pyc_trace_estimator_long_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
6037  __pyx_r = -1;
6038  __pyx_L0:;
6039  __PYX_XDEC_MEMVIEW(&__pyx_v_array_parameters, 1);
6040  __Pyx_TraceReturn(Py_None, 0);
6041  __Pyx_RefNannyFinishContext();
6042  return __pyx_r;
6043 }
6044 
6045 /* "View.MemoryView":123
6046  * cdef bint dtype_is_object
6047  *
6048  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
6049  * mode="c", bint allocate_buffer=True):
6050  *
6051  */
6052 
6053 /* Python wrapper */
6054 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6055 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6056  PyObject *__pyx_v_shape = 0;
6057  Py_ssize_t __pyx_v_itemsize;
6058  PyObject *__pyx_v_format = 0;
6059  PyObject *__pyx_v_mode = 0;
6060  int __pyx_v_allocate_buffer;
6061  int __pyx_lineno = 0;
6062  const char *__pyx_filename = NULL;
6063  int __pyx_clineno = 0;
6064  int __pyx_r;
6065  __Pyx_RefNannyDeclarations
6066  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
6067  {
6068  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0};
6069  PyObject* values[5] = {0,0,0,0,0};
6070  values[3] = ((PyObject *)__pyx_n_s_c);
6071  if (unlikely(__pyx_kwds)) {
6072  Py_ssize_t kw_args;
6073  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6074  switch (pos_args) {
6075  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6076  CYTHON_FALLTHROUGH;
6077  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6078  CYTHON_FALLTHROUGH;
6079  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6080  CYTHON_FALLTHROUGH;
6081  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6082  CYTHON_FALLTHROUGH;
6083  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6084  CYTHON_FALLTHROUGH;
6085  case 0: break;
6086  default: goto __pyx_L5_argtuple_error;
6087  }
6088  kw_args = PyDict_Size(__pyx_kwds);
6089  switch (pos_args) {
6090  case 0:
6091  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
6092  else goto __pyx_L5_argtuple_error;
6093  CYTHON_FALLTHROUGH;
6094  case 1:
6095  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
6096  else {
6097  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(2, 123, __pyx_L3_error)
6098  }
6099  CYTHON_FALLTHROUGH;
6100  case 2:
6101  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
6102  else {
6103  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(2, 123, __pyx_L3_error)
6104  }
6105  CYTHON_FALLTHROUGH;
6106  case 3:
6107  if (kw_args > 0) {
6108  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
6109  if (value) { values[3] = value; kw_args--; }
6110  }
6111  CYTHON_FALLTHROUGH;
6112  case 4:
6113  if (kw_args > 0) {
6114  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
6115  if (value) { values[4] = value; kw_args--; }
6116  }
6117  }
6118  if (unlikely(kw_args > 0)) {
6119  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 123, __pyx_L3_error)
6120  }
6121  } else {
6122  switch (PyTuple_GET_SIZE(__pyx_args)) {
6123  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6124  CYTHON_FALLTHROUGH;
6125  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6126  CYTHON_FALLTHROUGH;
6127  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6128  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6129  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6130  break;
6131  default: goto __pyx_L5_argtuple_error;
6132  }
6133  }
6134  __pyx_v_shape = ((PyObject*)values[0]);
6135  __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 123, __pyx_L3_error)
6136  __pyx_v_format = values[2];
6137  __pyx_v_mode = values[3];
6138  if (values[4]) {
6139  __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 124, __pyx_L3_error)
6140  } else {
6141 
6142  /* "View.MemoryView":124
6143  *
6144  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
6145  * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<<
6146  *
6147  * cdef int idx
6148  */
6149  __pyx_v_allocate_buffer = ((int)1);
6150  }
6151  }
6152  goto __pyx_L4_argument_unpacking_done;
6153  __pyx_L5_argtuple_error:;
6154  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 123, __pyx_L3_error)
6155  __pyx_L3_error:;
6156  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6157  __Pyx_RefNannyFinishContext();
6158  return -1;
6159  __pyx_L4_argument_unpacking_done:;
6160  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(2, 123, __pyx_L1_error)
6161  if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
6162  PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(2, 123, __pyx_L1_error)
6163  }
6164  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
6165 
6166  /* "View.MemoryView":123
6167  * cdef bint dtype_is_object
6168  *
6169  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
6170  * mode="c", bint allocate_buffer=True):
6171  *
6172  */
6173 
6174  /* function exit code */
6175  goto __pyx_L0;
6176  __pyx_L1_error:;
6177  __pyx_r = -1;
6178  __pyx_L0:;
6179  __Pyx_RefNannyFinishContext();
6180  return __pyx_r;
6181 }
6182 
6183 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer) {
6184  int __pyx_v_idx;
6185  Py_ssize_t __pyx_v_i;
6186  Py_ssize_t __pyx_v_dim;
6187  PyObject **__pyx_v_p;
6188  char __pyx_v_order;
6189  int __pyx_r;
6190  __Pyx_TraceDeclarations
6191  __Pyx_RefNannyDeclarations
6192  Py_ssize_t __pyx_t_1;
6193  int __pyx_t_2;
6194  PyObject *__pyx_t_3 = NULL;
6195  int __pyx_t_4;
6196  PyObject *__pyx_t_5 = NULL;
6197  PyObject *__pyx_t_6 = NULL;
6198  char *__pyx_t_7;
6199  int __pyx_t_8;
6200  Py_ssize_t __pyx_t_9;
6201  PyObject *__pyx_t_10 = NULL;
6202  Py_ssize_t __pyx_t_11;
6203  int __pyx_lineno = 0;
6204  const char *__pyx_filename = NULL;
6205  int __pyx_clineno = 0;
6206  __Pyx_RefNannySetupContext("__cinit__", 0);
6207  __Pyx_TraceCall("__cinit__", __pyx_f[2], 123, 0, __PYX_ERR(2, 123, __pyx_L1_error));
6208  __Pyx_INCREF(__pyx_v_format);
6209 
6210  /* "View.MemoryView":130
6211  * cdef PyObject **p
6212  *
6213  * self.ndim = <int> len(shape) # <<<<<<<<<<<<<<
6214  * self.itemsize = itemsize
6215  *
6216  */
6217  __Pyx_TraceLine(130,0,__PYX_ERR(2, 130, __pyx_L1_error))
6218  if (unlikely(__pyx_v_shape == Py_None)) {
6219  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
6220  __PYX_ERR(2, 130, __pyx_L1_error)
6221  }
6222  __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(2, 130, __pyx_L1_error)
6223  __pyx_v_self->ndim = ((int)__pyx_t_1);
6224 
6225  /* "View.MemoryView":131
6226  *
6227  * self.ndim = <int> len(shape)
6228  * self.itemsize = itemsize # <<<<<<<<<<<<<<
6229  *
6230  * if not self.ndim:
6231  */
6232  __Pyx_TraceLine(131,0,__PYX_ERR(2, 131, __pyx_L1_error))
6233  __pyx_v_self->itemsize = __pyx_v_itemsize;
6234 
6235  /* "View.MemoryView":133
6236  * self.itemsize = itemsize
6237  *
6238  * if not self.ndim: # <<<<<<<<<<<<<<
6239  * raise ValueError("Empty shape tuple for cython.array")
6240  *
6241  */
6242  __Pyx_TraceLine(133,0,__PYX_ERR(2, 133, __pyx_L1_error))
6243  __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
6244  if (unlikely(__pyx_t_2)) {
6245 
6246  /* "View.MemoryView":134
6247  *
6248  * if not self.ndim:
6249  * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
6250  *
6251  * if itemsize <= 0:
6252  */
6253  __Pyx_TraceLine(134,0,__PYX_ERR(2, 134, __pyx_L1_error))
6254  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 134, __pyx_L1_error)
6255  __Pyx_GOTREF(__pyx_t_3);
6256  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6257  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6258  __PYX_ERR(2, 134, __pyx_L1_error)
6259 
6260  /* "View.MemoryView":133
6261  * self.itemsize = itemsize
6262  *
6263  * if not self.ndim: # <<<<<<<<<<<<<<
6264  * raise ValueError("Empty shape tuple for cython.array")
6265  *
6266  */
6267  }
6268 
6269  /* "View.MemoryView":136
6270  * raise ValueError("Empty shape tuple for cython.array")
6271  *
6272  * if itemsize <= 0: # <<<<<<<<<<<<<<
6273  * raise ValueError("itemsize <= 0 for cython.array")
6274  *
6275  */
6276  __Pyx_TraceLine(136,0,__PYX_ERR(2, 136, __pyx_L1_error))
6277  __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
6278  if (unlikely(__pyx_t_2)) {
6279 
6280  /* "View.MemoryView":137
6281  *
6282  * if itemsize <= 0:
6283  * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
6284  *
6285  * if not isinstance(format, bytes):
6286  */
6287  __Pyx_TraceLine(137,0,__PYX_ERR(2, 137, __pyx_L1_error))
6288  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 137, __pyx_L1_error)
6289  __Pyx_GOTREF(__pyx_t_3);
6290  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6291  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6292  __PYX_ERR(2, 137, __pyx_L1_error)
6293 
6294  /* "View.MemoryView":136
6295  * raise ValueError("Empty shape tuple for cython.array")
6296  *
6297  * if itemsize <= 0: # <<<<<<<<<<<<<<
6298  * raise ValueError("itemsize <= 0 for cython.array")
6299  *
6300  */
6301  }
6302 
6303  /* "View.MemoryView":139
6304  * raise ValueError("itemsize <= 0 for cython.array")
6305  *
6306  * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
6307  * format = format.encode('ASCII')
6308  * self._format = format # keep a reference to the byte string
6309  */
6310  __Pyx_TraceLine(139,0,__PYX_ERR(2, 139, __pyx_L1_error))
6311  __pyx_t_2 = PyBytes_Check(__pyx_v_format);
6312  __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
6313  if (__pyx_t_4) {
6314 
6315  /* "View.MemoryView":140
6316  *
6317  * if not isinstance(format, bytes):
6318  * format = format.encode('ASCII') # <<<<<<<<<<<<<<
6319  * self._format = format # keep a reference to the byte string
6320  * self.format = self._format
6321  */
6322  __Pyx_TraceLine(140,0,__PYX_ERR(2, 140, __pyx_L1_error))
6323  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 140, __pyx_L1_error)
6324  __Pyx_GOTREF(__pyx_t_5);
6325  __pyx_t_6 = NULL;
6326  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
6327  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
6328  if (likely(__pyx_t_6)) {
6329  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
6330  __Pyx_INCREF(__pyx_t_6);
6331  __Pyx_INCREF(function);
6332  __Pyx_DECREF_SET(__pyx_t_5, function);
6333  }
6334  }
6335  __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_s_ASCII) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_s_ASCII);
6336  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
6337  if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 140, __pyx_L1_error)
6338  __Pyx_GOTREF(__pyx_t_3);
6339  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6340  __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3);
6341  __pyx_t_3 = 0;
6342 
6343  /* "View.MemoryView":139
6344  * raise ValueError("itemsize <= 0 for cython.array")
6345  *
6346  * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
6347  * format = format.encode('ASCII')
6348  * self._format = format # keep a reference to the byte string
6349  */
6350  }
6351 
6352  /* "View.MemoryView":141
6353  * if not isinstance(format, bytes):
6354  * format = format.encode('ASCII')
6355  * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<<
6356  * self.format = self._format
6357  *
6358  */
6359  __Pyx_TraceLine(141,0,__PYX_ERR(2, 141, __pyx_L1_error))
6360  if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||((void)PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(2, 141, __pyx_L1_error)
6361  __pyx_t_3 = __pyx_v_format;
6362  __Pyx_INCREF(__pyx_t_3);
6363  __Pyx_GIVEREF(__pyx_t_3);
6364  __Pyx_GOTREF(__pyx_v_self->_format);
6365  __Pyx_DECREF(__pyx_v_self->_format);
6366  __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
6367  __pyx_t_3 = 0;
6368 
6369  /* "View.MemoryView":142
6370  * format = format.encode('ASCII')
6371  * self._format = format # keep a reference to the byte string
6372  * self.format = self._format # <<<<<<<<<<<<<<
6373  *
6374  *
6375  */
6376  __Pyx_TraceLine(142,0,__PYX_ERR(2, 142, __pyx_L1_error))
6377  if (unlikely(__pyx_v_self->_format == Py_None)) {
6378  PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
6379  __PYX_ERR(2, 142, __pyx_L1_error)
6380  }
6381  __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(2, 142, __pyx_L1_error)
6382  __pyx_v_self->format = __pyx_t_7;
6383 
6384  /* "View.MemoryView":145
6385  *
6386  *
6387  * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<<
6388  * self._strides = self._shape + self.ndim
6389  *
6390  */
6391  __Pyx_TraceLine(145,0,__PYX_ERR(2, 145, __pyx_L1_error))
6392  __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
6393 
6394  /* "View.MemoryView":146
6395  *
6396  * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
6397  * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<<
6398  *
6399  * if not self._shape:
6400  */
6401  __Pyx_TraceLine(146,0,__PYX_ERR(2, 146, __pyx_L1_error))
6402  __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
6403 
6404  /* "View.MemoryView":148
6405  * self._strides = self._shape + self.ndim
6406  *
6407  * if not self._shape: # <<<<<<<<<<<<<<
6408  * raise MemoryError("unable to allocate shape and strides.")
6409  *
6410  */
6411  __Pyx_TraceLine(148,0,__PYX_ERR(2, 148, __pyx_L1_error))
6412  __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
6413  if (unlikely(__pyx_t_4)) {
6414 
6415  /* "View.MemoryView":149
6416  *
6417  * if not self._shape:
6418  * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
6419  *
6420  *
6421  */
6422  __Pyx_TraceLine(149,0,__PYX_ERR(2, 149, __pyx_L1_error))
6423  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 149, __pyx_L1_error)
6424  __Pyx_GOTREF(__pyx_t_3);
6425  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6426  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6427  __PYX_ERR(2, 149, __pyx_L1_error)
6428 
6429  /* "View.MemoryView":148
6430  * self._strides = self._shape + self.ndim
6431  *
6432  * if not self._shape: # <<<<<<<<<<<<<<
6433  * raise MemoryError("unable to allocate shape and strides.")
6434  *
6435  */
6436  }
6437 
6438  /* "View.MemoryView":152
6439  *
6440  *
6441  * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
6442  * if dim <= 0:
6443  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
6444  */
6445  __Pyx_TraceLine(152,0,__PYX_ERR(2, 152, __pyx_L1_error))
6446  __pyx_t_8 = 0;
6447  __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
6448  for (;;) {
6449  if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
6450  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6451  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(2, 152, __pyx_L1_error)
6452  #else
6453  __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 152, __pyx_L1_error)
6454  __Pyx_GOTREF(__pyx_t_5);
6455  #endif
6456  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 152, __pyx_L1_error)
6457  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6458  __pyx_v_dim = __pyx_t_9;
6459  __pyx_v_idx = __pyx_t_8;
6460  __pyx_t_8 = (__pyx_t_8 + 1);
6461 
6462  /* "View.MemoryView":153
6463  *
6464  * for idx, dim in enumerate(shape):
6465  * if dim <= 0: # <<<<<<<<<<<<<<
6466  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
6467  * self._shape[idx] = dim
6468  */
6469  __Pyx_TraceLine(153,0,__PYX_ERR(2, 153, __pyx_L1_error))
6470  __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
6471  if (unlikely(__pyx_t_4)) {
6472 
6473  /* "View.MemoryView":154
6474  * for idx, dim in enumerate(shape):
6475  * if dim <= 0:
6476  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) # <<<<<<<<<<<<<<
6477  * self._shape[idx] = dim
6478  *
6479  */
6480  __Pyx_TraceLine(154,0,__PYX_ERR(2, 154, __pyx_L1_error))
6481  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 154, __pyx_L1_error)
6482  __Pyx_GOTREF(__pyx_t_5);
6483  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 154, __pyx_L1_error)
6484  __Pyx_GOTREF(__pyx_t_6);
6485  __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 154, __pyx_L1_error)
6486  __Pyx_GOTREF(__pyx_t_10);
6487  __Pyx_GIVEREF(__pyx_t_5);
6488  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5);
6489  __Pyx_GIVEREF(__pyx_t_6);
6490  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6);
6491  __pyx_t_5 = 0;
6492  __pyx_t_6 = 0;
6493  __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 154, __pyx_L1_error)
6494  __Pyx_GOTREF(__pyx_t_6);
6495  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6496  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 154, __pyx_L1_error)
6497  __Pyx_GOTREF(__pyx_t_10);
6498  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6499  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
6500  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6501  __PYX_ERR(2, 154, __pyx_L1_error)
6502 
6503  /* "View.MemoryView":153
6504  *
6505  * for idx, dim in enumerate(shape):
6506  * if dim <= 0: # <<<<<<<<<<<<<<
6507  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
6508  * self._shape[idx] = dim
6509  */
6510  }
6511 
6512  /* "View.MemoryView":155
6513  * if dim <= 0:
6514  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
6515  * self._shape[idx] = dim # <<<<<<<<<<<<<<
6516  *
6517  * cdef char order
6518  */
6519  __Pyx_TraceLine(155,0,__PYX_ERR(2, 155, __pyx_L1_error))
6520  (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
6521 
6522  /* "View.MemoryView":152
6523  *
6524  *
6525  * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
6526  * if dim <= 0:
6527  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
6528  */
6529  __Pyx_TraceLine(152,0,__PYX_ERR(2, 152, __pyx_L1_error))
6530  }
6531  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6532 
6533  /* "View.MemoryView":158
6534  *
6535  * cdef char order
6536  * if mode == 'fortran': # <<<<<<<<<<<<<<
6537  * order = b'F'
6538  * self.mode = u'fortran'
6539  */
6540  __Pyx_TraceLine(158,0,__PYX_ERR(2, 158, __pyx_L1_error))
6541  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 158, __pyx_L1_error)
6542  if (__pyx_t_4) {
6543 
6544  /* "View.MemoryView":159
6545  * cdef char order
6546  * if mode == 'fortran':
6547  * order = b'F' # <<<<<<<<<<<<<<
6548  * self.mode = u'fortran'
6549  * elif mode == 'c':
6550  */
6551  __Pyx_TraceLine(159,0,__PYX_ERR(2, 159, __pyx_L1_error))
6552  __pyx_v_order = 'F';
6553 
6554  /* "View.MemoryView":160
6555  * if mode == 'fortran':
6556  * order = b'F'
6557  * self.mode = u'fortran' # <<<<<<<<<<<<<<
6558  * elif mode == 'c':
6559  * order = b'C'
6560  */
6561  __Pyx_TraceLine(160,0,__PYX_ERR(2, 160, __pyx_L1_error))
6562  __Pyx_INCREF(__pyx_n_u_fortran);
6563  __Pyx_GIVEREF(__pyx_n_u_fortran);
6564  __Pyx_GOTREF(__pyx_v_self->mode);
6565  __Pyx_DECREF(__pyx_v_self->mode);
6566  __pyx_v_self->mode = __pyx_n_u_fortran;
6567 
6568  /* "View.MemoryView":158
6569  *
6570  * cdef char order
6571  * if mode == 'fortran': # <<<<<<<<<<<<<<
6572  * order = b'F'
6573  * self.mode = u'fortran'
6574  */
6575  goto __pyx_L10;
6576  }
6577 
6578  /* "View.MemoryView":161
6579  * order = b'F'
6580  * self.mode = u'fortran'
6581  * elif mode == 'c': # <<<<<<<<<<<<<<
6582  * order = b'C'
6583  * self.mode = u'c'
6584  */
6585  __Pyx_TraceLine(161,0,__PYX_ERR(2, 161, __pyx_L1_error))
6586  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 161, __pyx_L1_error)
6587  if (likely(__pyx_t_4)) {
6588 
6589  /* "View.MemoryView":162
6590  * self.mode = u'fortran'
6591  * elif mode == 'c':
6592  * order = b'C' # <<<<<<<<<<<<<<
6593  * self.mode = u'c'
6594  * else:
6595  */
6596  __Pyx_TraceLine(162,0,__PYX_ERR(2, 162, __pyx_L1_error))
6597  __pyx_v_order = 'C';
6598 
6599  /* "View.MemoryView":163
6600  * elif mode == 'c':
6601  * order = b'C'
6602  * self.mode = u'c' # <<<<<<<<<<<<<<
6603  * else:
6604  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
6605  */
6606  __Pyx_TraceLine(163,0,__PYX_ERR(2, 163, __pyx_L1_error))
6607  __Pyx_INCREF(__pyx_n_u_c);
6608  __Pyx_GIVEREF(__pyx_n_u_c);
6609  __Pyx_GOTREF(__pyx_v_self->mode);
6610  __Pyx_DECREF(__pyx_v_self->mode);
6611  __pyx_v_self->mode = __pyx_n_u_c;
6612 
6613  /* "View.MemoryView":161
6614  * order = b'F'
6615  * self.mode = u'fortran'
6616  * elif mode == 'c': # <<<<<<<<<<<<<<
6617  * order = b'C'
6618  * self.mode = u'c'
6619  */
6620  goto __pyx_L10;
6621  }
6622 
6623  /* "View.MemoryView":165
6624  * self.mode = u'c'
6625  * else:
6626  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) # <<<<<<<<<<<<<<
6627  *
6628  * self.len = fill_contig_strides_array(self._shape, self._strides,
6629  */
6630  __Pyx_TraceLine(165,0,__PYX_ERR(2, 165, __pyx_L1_error))
6631  /*else*/ {
6632  __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 165, __pyx_L1_error)
6633  __Pyx_GOTREF(__pyx_t_3);
6634  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 165, __pyx_L1_error)
6635  __Pyx_GOTREF(__pyx_t_10);
6636  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6637  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
6638  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6639  __PYX_ERR(2, 165, __pyx_L1_error)
6640  }
6641  __pyx_L10:;
6642 
6643  /* "View.MemoryView":167
6644  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
6645  *
6646  * self.len = fill_contig_strides_array(self._shape, self._strides, # <<<<<<<<<<<<<<
6647  * itemsize, self.ndim, order)
6648  *
6649  */
6650  __Pyx_TraceLine(167,0,__PYX_ERR(2, 167, __pyx_L1_error))
6651  __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
6652 
6653  /* "View.MemoryView":170
6654  * itemsize, self.ndim, order)
6655  *
6656  * self.free_data = allocate_buffer # <<<<<<<<<<<<<<
6657  * self.dtype_is_object = format == b'O'
6658  * if allocate_buffer:
6659  */
6660  __Pyx_TraceLine(170,0,__PYX_ERR(2, 170, __pyx_L1_error))
6661  __pyx_v_self->free_data = __pyx_v_allocate_buffer;
6662 
6663  /* "View.MemoryView":171
6664  *
6665  * self.free_data = allocate_buffer
6666  * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<<
6667  * if allocate_buffer:
6668  *
6669  */
6670  __Pyx_TraceLine(171,0,__PYX_ERR(2, 171, __pyx_L1_error))
6671  __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 171, __pyx_L1_error)
6672  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 171, __pyx_L1_error)
6673  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6674  __pyx_v_self->dtype_is_object = __pyx_t_4;
6675 
6676  /* "View.MemoryView":172
6677  * self.free_data = allocate_buffer
6678  * self.dtype_is_object = format == b'O'
6679  * if allocate_buffer: # <<<<<<<<<<<<<<
6680  *
6681  *
6682  */
6683  __Pyx_TraceLine(172,0,__PYX_ERR(2, 172, __pyx_L1_error))
6684  __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
6685  if (__pyx_t_4) {
6686 
6687  /* "View.MemoryView":175
6688  *
6689  *
6690  * self.data = <char *>malloc(self.len) # <<<<<<<<<<<<<<
6691  * if not self.data:
6692  * raise MemoryError("unable to allocate array data.")
6693  */
6694  __Pyx_TraceLine(175,0,__PYX_ERR(2, 175, __pyx_L1_error))
6695  __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
6696 
6697  /* "View.MemoryView":176
6698  *
6699  * self.data = <char *>malloc(self.len)
6700  * if not self.data: # <<<<<<<<<<<<<<
6701  * raise MemoryError("unable to allocate array data.")
6702  *
6703  */
6704  __Pyx_TraceLine(176,0,__PYX_ERR(2, 176, __pyx_L1_error))
6705  __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
6706  if (unlikely(__pyx_t_4)) {
6707 
6708  /* "View.MemoryView":177
6709  * self.data = <char *>malloc(self.len)
6710  * if not self.data:
6711  * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
6712  *
6713  * if self.dtype_is_object:
6714  */
6715  __Pyx_TraceLine(177,0,__PYX_ERR(2, 177, __pyx_L1_error))
6716  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 177, __pyx_L1_error)
6717  __Pyx_GOTREF(__pyx_t_10);
6718  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
6719  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6720  __PYX_ERR(2, 177, __pyx_L1_error)
6721 
6722  /* "View.MemoryView":176
6723  *
6724  * self.data = <char *>malloc(self.len)
6725  * if not self.data: # <<<<<<<<<<<<<<
6726  * raise MemoryError("unable to allocate array data.")
6727  *
6728  */
6729  }
6730 
6731  /* "View.MemoryView":179
6732  * raise MemoryError("unable to allocate array data.")
6733  *
6734  * if self.dtype_is_object: # <<<<<<<<<<<<<<
6735  * p = <PyObject **> self.data
6736  * for i in range(self.len / itemsize):
6737  */
6738  __Pyx_TraceLine(179,0,__PYX_ERR(2, 179, __pyx_L1_error))
6739  __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
6740  if (__pyx_t_4) {
6741 
6742  /* "View.MemoryView":180
6743  *
6744  * if self.dtype_is_object:
6745  * p = <PyObject **> self.data # <<<<<<<<<<<<<<
6746  * for i in range(self.len / itemsize):
6747  * p[i] = Py_None
6748  */
6749  __Pyx_TraceLine(180,0,__PYX_ERR(2, 180, __pyx_L1_error))
6750  __pyx_v_p = ((PyObject **)__pyx_v_self->data);
6751 
6752  /* "View.MemoryView":181
6753  * if self.dtype_is_object:
6754  * p = <PyObject **> self.data
6755  * for i in range(self.len / itemsize): # <<<<<<<<<<<<<<
6756  * p[i] = Py_None
6757  * Py_INCREF(Py_None)
6758  */
6759  __Pyx_TraceLine(181,0,__PYX_ERR(2, 181, __pyx_L1_error))
6760  if (unlikely(__pyx_v_itemsize == 0)) {
6761  PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
6762  __PYX_ERR(2, 181, __pyx_L1_error)
6763  }
6764  else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
6765  PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
6766  __PYX_ERR(2, 181, __pyx_L1_error)
6767  }
6768  __pyx_t_1 = (__pyx_v_self->len / __pyx_v_itemsize);
6769  __pyx_t_9 = __pyx_t_1;
6770  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
6771  __pyx_v_i = __pyx_t_11;
6772 
6773  /* "View.MemoryView":182
6774  * p = <PyObject **> self.data
6775  * for i in range(self.len / itemsize):
6776  * p[i] = Py_None # <<<<<<<<<<<<<<
6777  * Py_INCREF(Py_None)
6778  *
6779  */
6780  __Pyx_TraceLine(182,0,__PYX_ERR(2, 182, __pyx_L1_error))
6781  (__pyx_v_p[__pyx_v_i]) = Py_None;
6782 
6783  /* "View.MemoryView":183
6784  * for i in range(self.len / itemsize):
6785  * p[i] = Py_None
6786  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
6787  *
6788  * @cname('getbuffer')
6789  */
6790  __Pyx_TraceLine(183,0,__PYX_ERR(2, 183, __pyx_L1_error))
6791  Py_INCREF(Py_None);
6792  }
6793 
6794  /* "View.MemoryView":179
6795  * raise MemoryError("unable to allocate array data.")
6796  *
6797  * if self.dtype_is_object: # <<<<<<<<<<<<<<
6798  * p = <PyObject **> self.data
6799  * for i in range(self.len / itemsize):
6800  */
6801  }
6802 
6803  /* "View.MemoryView":172
6804  * self.free_data = allocate_buffer
6805  * self.dtype_is_object = format == b'O'
6806  * if allocate_buffer: # <<<<<<<<<<<<<<
6807  *
6808  *
6809  */
6810  }
6811 
6812  /* "View.MemoryView":123
6813  * cdef bint dtype_is_object
6814  *
6815  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
6816  * mode="c", bint allocate_buffer=True):
6817  *
6818  */
6819 
6820  /* function exit code */
6821  __pyx_r = 0;
6822  goto __pyx_L0;
6823  __pyx_L1_error:;
6824  __Pyx_XDECREF(__pyx_t_3);
6825  __Pyx_XDECREF(__pyx_t_5);
6826  __Pyx_XDECREF(__pyx_t_6);
6827  __Pyx_XDECREF(__pyx_t_10);
6828  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6829  __pyx_r = -1;
6830  __pyx_L0:;
6831  __Pyx_XDECREF(__pyx_v_format);
6832  __Pyx_TraceReturn(Py_None, 0);
6833  __Pyx_RefNannyFinishContext();
6834  return __pyx_r;
6835 }
6836 
6837 /* "View.MemoryView":186
6838  *
6839  * @cname('getbuffer')
6840  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
6841  * cdef int bufmode = -1
6842  * if self.mode == u"c":
6843  */
6844 
6845 /* Python wrapper */
6846 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
6847 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
6848  int __pyx_r;
6849  __Pyx_RefNannyDeclarations
6850  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
6851  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
6852 
6853  /* function exit code */
6854  __Pyx_RefNannyFinishContext();
6855  return __pyx_r;
6856 }
6857 
6858 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
6859  int __pyx_v_bufmode;
6860  int __pyx_r;
6861  __Pyx_TraceDeclarations
6862  __Pyx_RefNannyDeclarations
6863  int __pyx_t_1;
6864  int __pyx_t_2;
6865  PyObject *__pyx_t_3 = NULL;
6866  char *__pyx_t_4;
6867  Py_ssize_t __pyx_t_5;
6868  int __pyx_t_6;
6869  Py_ssize_t *__pyx_t_7;
6870  int __pyx_lineno = 0;
6871  const char *__pyx_filename = NULL;
6872  int __pyx_clineno = 0;
6873  if (__pyx_v_info == NULL) {
6874  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
6875  return -1;
6876  }
6877  __Pyx_RefNannySetupContext("__getbuffer__", 0);
6878  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
6879  __Pyx_GIVEREF(__pyx_v_info->obj);
6880  __Pyx_TraceCall("__getbuffer__", __pyx_f[2], 186, 0, __PYX_ERR(2, 186, __pyx_L1_error));
6881 
6882  /* "View.MemoryView":187
6883  * @cname('getbuffer')
6884  * def __getbuffer__(self, Py_buffer *info, int flags):
6885  * cdef int bufmode = -1 # <<<<<<<<<<<<<<
6886  * if self.mode == u"c":
6887  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6888  */
6889  __Pyx_TraceLine(187,0,__PYX_ERR(2, 187, __pyx_L1_error))
6890  __pyx_v_bufmode = -1;
6891 
6892  /* "View.MemoryView":188
6893  * def __getbuffer__(self, Py_buffer *info, int flags):
6894  * cdef int bufmode = -1
6895  * if self.mode == u"c": # <<<<<<<<<<<<<<
6896  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6897  * elif self.mode == u"fortran":
6898  */
6899  __Pyx_TraceLine(188,0,__PYX_ERR(2, 188, __pyx_L1_error))
6900  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 188, __pyx_L1_error)
6901  __pyx_t_2 = (__pyx_t_1 != 0);
6902  if (__pyx_t_2) {
6903 
6904  /* "View.MemoryView":189
6905  * cdef int bufmode = -1
6906  * if self.mode == u"c":
6907  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
6908  * elif self.mode == u"fortran":
6909  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6910  */
6911  __Pyx_TraceLine(189,0,__PYX_ERR(2, 189, __pyx_L1_error))
6912  __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
6913 
6914  /* "View.MemoryView":188
6915  * def __getbuffer__(self, Py_buffer *info, int flags):
6916  * cdef int bufmode = -1
6917  * if self.mode == u"c": # <<<<<<<<<<<<<<
6918  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6919  * elif self.mode == u"fortran":
6920  */
6921  goto __pyx_L3;
6922  }
6923 
6924  /* "View.MemoryView":190
6925  * if self.mode == u"c":
6926  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6927  * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
6928  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6929  * if not (flags & bufmode):
6930  */
6931  __Pyx_TraceLine(190,0,__PYX_ERR(2, 190, __pyx_L1_error))
6932  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 190, __pyx_L1_error)
6933  __pyx_t_1 = (__pyx_t_2 != 0);
6934  if (__pyx_t_1) {
6935 
6936  /* "View.MemoryView":191
6937  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6938  * elif self.mode == u"fortran":
6939  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
6940  * if not (flags & bufmode):
6941  * raise ValueError("Can only create a buffer that is contiguous in memory.")
6942  */
6943  __Pyx_TraceLine(191,0,__PYX_ERR(2, 191, __pyx_L1_error))
6944  __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
6945 
6946  /* "View.MemoryView":190
6947  * if self.mode == u"c":
6948  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6949  * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
6950  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6951  * if not (flags & bufmode):
6952  */
6953  }
6954  __pyx_L3:;
6955 
6956  /* "View.MemoryView":192
6957  * elif self.mode == u"fortran":
6958  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6959  * if not (flags & bufmode): # <<<<<<<<<<<<<<
6960  * raise ValueError("Can only create a buffer that is contiguous in memory.")
6961  * info.buf = self.data
6962  */
6963  __Pyx_TraceLine(192,0,__PYX_ERR(2, 192, __pyx_L1_error))
6964  __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
6965  if (unlikely(__pyx_t_1)) {
6966 
6967  /* "View.MemoryView":193
6968  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6969  * if not (flags & bufmode):
6970  * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
6971  * info.buf = self.data
6972  * info.len = self.len
6973  */
6974  __Pyx_TraceLine(193,0,__PYX_ERR(2, 193, __pyx_L1_error))
6975  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 193, __pyx_L1_error)
6976  __Pyx_GOTREF(__pyx_t_3);
6977  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6978  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6979  __PYX_ERR(2, 193, __pyx_L1_error)
6980 
6981  /* "View.MemoryView":192
6982  * elif self.mode == u"fortran":
6983  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6984  * if not (flags & bufmode): # <<<<<<<<<<<<<<
6985  * raise ValueError("Can only create a buffer that is contiguous in memory.")
6986  * info.buf = self.data
6987  */
6988  }
6989 
6990  /* "View.MemoryView":194
6991  * if not (flags & bufmode):
6992  * raise ValueError("Can only create a buffer that is contiguous in memory.")
6993  * info.buf = self.data # <<<<<<<<<<<<<<
6994  * info.len = self.len
6995  * info.ndim = self.ndim
6996  */
6997  __Pyx_TraceLine(194,0,__PYX_ERR(2, 194, __pyx_L1_error))
6998  __pyx_t_4 = __pyx_v_self->data;
6999  __pyx_v_info->buf = __pyx_t_4;
7000 
7001  /* "View.MemoryView":195
7002  * raise ValueError("Can only create a buffer that is contiguous in memory.")
7003  * info.buf = self.data
7004  * info.len = self.len # <<<<<<<<<<<<<<
7005  * info.ndim = self.ndim
7006  * info.shape = self._shape
7007  */
7008  __Pyx_TraceLine(195,0,__PYX_ERR(2, 195, __pyx_L1_error))
7009  __pyx_t_5 = __pyx_v_self->len;
7010  __pyx_v_info->len = __pyx_t_5;
7011 
7012  /* "View.MemoryView":196
7013  * info.buf = self.data
7014  * info.len = self.len
7015  * info.ndim = self.ndim # <<<<<<<<<<<<<<
7016  * info.shape = self._shape
7017  * info.strides = self._strides
7018  */
7019  __Pyx_TraceLine(196,0,__PYX_ERR(2, 196, __pyx_L1_error))
7020  __pyx_t_6 = __pyx_v_self->ndim;
7021  __pyx_v_info->ndim = __pyx_t_6;
7022 
7023  /* "View.MemoryView":197
7024  * info.len = self.len
7025  * info.ndim = self.ndim
7026  * info.shape = self._shape # <<<<<<<<<<<<<<
7027  * info.strides = self._strides
7028  * info.suboffsets = NULL
7029  */
7030  __Pyx_TraceLine(197,0,__PYX_ERR(2, 197, __pyx_L1_error))
7031  __pyx_t_7 = __pyx_v_self->_shape;
7032  __pyx_v_info->shape = __pyx_t_7;
7033 
7034  /* "View.MemoryView":198
7035  * info.ndim = self.ndim
7036  * info.shape = self._shape
7037  * info.strides = self._strides # <<<<<<<<<<<<<<
7038  * info.suboffsets = NULL
7039  * info.itemsize = self.itemsize
7040  */
7041  __Pyx_TraceLine(198,0,__PYX_ERR(2, 198, __pyx_L1_error))
7042  __pyx_t_7 = __pyx_v_self->_strides;
7043  __pyx_v_info->strides = __pyx_t_7;
7044 
7045  /* "View.MemoryView":199
7046  * info.shape = self._shape
7047  * info.strides = self._strides
7048  * info.suboffsets = NULL # <<<<<<<<<<<<<<
7049  * info.itemsize = self.itemsize
7050  * info.readonly = 0
7051  */
7052  __Pyx_TraceLine(199,0,__PYX_ERR(2, 199, __pyx_L1_error))
7053  __pyx_v_info->suboffsets = NULL;
7054 
7055  /* "View.MemoryView":200
7056  * info.strides = self._strides
7057  * info.suboffsets = NULL
7058  * info.itemsize = self.itemsize # <<<<<<<<<<<<<<
7059  * info.readonly = 0
7060  *
7061  */
7062  __Pyx_TraceLine(200,0,__PYX_ERR(2, 200, __pyx_L1_error))
7063  __pyx_t_5 = __pyx_v_self->itemsize;
7064  __pyx_v_info->itemsize = __pyx_t_5;
7065 
7066  /* "View.MemoryView":201
7067  * info.suboffsets = NULL
7068  * info.itemsize = self.itemsize
7069  * info.readonly = 0 # <<<<<<<<<<<<<<
7070  *
7071  * if flags & PyBUF_FORMAT:
7072  */
7073  __Pyx_TraceLine(201,0,__PYX_ERR(2, 201, __pyx_L1_error))
7074  __pyx_v_info->readonly = 0;
7075 
7076  /* "View.MemoryView":203
7077  * info.readonly = 0
7078  *
7079  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
7080  * info.format = self.format
7081  * else:
7082  */
7083  __Pyx_TraceLine(203,0,__PYX_ERR(2, 203, __pyx_L1_error))
7084  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
7085  if (__pyx_t_1) {
7086 
7087  /* "View.MemoryView":204
7088  *
7089  * if flags & PyBUF_FORMAT:
7090  * info.format = self.format # <<<<<<<<<<<<<<
7091  * else:
7092  * info.format = NULL
7093  */
7094  __Pyx_TraceLine(204,0,__PYX_ERR(2, 204, __pyx_L1_error))
7095  __pyx_t_4 = __pyx_v_self->format;
7096  __pyx_v_info->format = __pyx_t_4;
7097 
7098  /* "View.MemoryView":203
7099  * info.readonly = 0
7100  *
7101  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
7102  * info.format = self.format
7103  * else:
7104  */
7105  goto __pyx_L5;
7106  }
7107 
7108  /* "View.MemoryView":206
7109  * info.format = self.format
7110  * else:
7111  * info.format = NULL # <<<<<<<<<<<<<<
7112  *
7113  * info.obj = self
7114  */
7115  __Pyx_TraceLine(206,0,__PYX_ERR(2, 206, __pyx_L1_error))
7116  /*else*/ {
7117  __pyx_v_info->format = NULL;
7118  }
7119  __pyx_L5:;
7120 
7121  /* "View.MemoryView":208
7122  * info.format = NULL
7123  *
7124  * info.obj = self # <<<<<<<<<<<<<<
7125  *
7126  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
7127  */
7128  __Pyx_TraceLine(208,0,__PYX_ERR(2, 208, __pyx_L1_error))
7129  __Pyx_INCREF(((PyObject *)__pyx_v_self));
7130  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
7131  __Pyx_GOTREF(__pyx_v_info->obj);
7132  __Pyx_DECREF(__pyx_v_info->obj);
7133  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
7134 
7135  /* "View.MemoryView":186
7136  *
7137  * @cname('getbuffer')
7138  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
7139  * cdef int bufmode = -1
7140  * if self.mode == u"c":
7141  */
7142 
7143  /* function exit code */
7144  __pyx_r = 0;
7145  goto __pyx_L0;
7146  __pyx_L1_error:;
7147  __Pyx_XDECREF(__pyx_t_3);
7148  __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7149  __pyx_r = -1;
7150  if (__pyx_v_info->obj != NULL) {
7151  __Pyx_GOTREF(__pyx_v_info->obj);
7152  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
7153  }
7154  goto __pyx_L2;
7155  __pyx_L0:;
7156  if (__pyx_v_info->obj == Py_None) {
7157  __Pyx_GOTREF(__pyx_v_info->obj);
7158  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
7159  }
7160  __pyx_L2:;
7161  __Pyx_TraceReturn(Py_None, 0);
7162  __Pyx_RefNannyFinishContext();
7163  return __pyx_r;
7164 }
7165 
7166 /* "View.MemoryView":212
7167  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
7168  *
7169  * def __dealloc__(array self): # <<<<<<<<<<<<<<
7170  * if self.callback_free_data != NULL:
7171  * self.callback_free_data(self.data)
7172  */
7173 
7174 /* Python wrapper */
7175 static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
7176 static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
7177  __Pyx_RefNannyDeclarations
7178  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
7179  __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));
7180 
7181  /* function exit code */
7182  __Pyx_RefNannyFinishContext();
7183 }
7184 
7185 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
7186  __Pyx_TraceDeclarations
7187  __Pyx_RefNannyDeclarations
7188  int __pyx_t_1;
7189  int __pyx_lineno = 0;
7190  const char *__pyx_filename = NULL;
7191  int __pyx_clineno = 0;
7192  __Pyx_RefNannySetupContext("__dealloc__", 0);
7193  __Pyx_TraceCall("__dealloc__", __pyx_f[2], 212, 0, __PYX_ERR(2, 212, __pyx_L1_error));
7194 
7195  /* "View.MemoryView":213
7196  *
7197  * def __dealloc__(array self):
7198  * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
7199  * self.callback_free_data(self.data)
7200  * elif self.free_data:
7201  */
7202  __Pyx_TraceLine(213,0,__PYX_ERR(2, 213, __pyx_L1_error))
7203  __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
7204  if (__pyx_t_1) {
7205 
7206  /* "View.MemoryView":214
7207  * def __dealloc__(array self):
7208  * if self.callback_free_data != NULL:
7209  * self.callback_free_data(self.data) # <<<<<<<<<<<<<<
7210  * elif self.free_data:
7211  * if self.dtype_is_object:
7212  */
7213  __Pyx_TraceLine(214,0,__PYX_ERR(2, 214, __pyx_L1_error))
7214  __pyx_v_self->callback_free_data(__pyx_v_self->data);
7215 
7216  /* "View.MemoryView":213
7217  *
7218  * def __dealloc__(array self):
7219  * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
7220  * self.callback_free_data(self.data)
7221  * elif self.free_data:
7222  */
7223  goto __pyx_L3;
7224  }
7225 
7226  /* "View.MemoryView":215
7227  * if self.callback_free_data != NULL:
7228  * self.callback_free_data(self.data)
7229  * elif self.free_data: # <<<<<<<<<<<<<<
7230  * if self.dtype_is_object:
7231  * refcount_objects_in_slice(self.data, self._shape,
7232  */
7233  __Pyx_TraceLine(215,0,__PYX_ERR(2, 215, __pyx_L1_error))
7234  __pyx_t_1 = (__pyx_v_self->free_data != 0);
7235  if (__pyx_t_1) {
7236 
7237  /* "View.MemoryView":216
7238  * self.callback_free_data(self.data)
7239  * elif self.free_data:
7240  * if self.dtype_is_object: # <<<<<<<<<<<<<<
7241  * refcount_objects_in_slice(self.data, self._shape,
7242  * self._strides, self.ndim, False)
7243  */
7244  __Pyx_TraceLine(216,0,__PYX_ERR(2, 216, __pyx_L1_error))
7245  __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
7246  if (__pyx_t_1) {
7247 
7248  /* "View.MemoryView":217
7249  * elif self.free_data:
7250  * if self.dtype_is_object:
7251  * refcount_objects_in_slice(self.data, self._shape, # <<<<<<<<<<<<<<
7252  * self._strides, self.ndim, False)
7253  * free(self.data)
7254  */
7255  __Pyx_TraceLine(217,0,__PYX_ERR(2, 217, __pyx_L1_error))
7256  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
7257 
7258  /* "View.MemoryView":216
7259  * self.callback_free_data(self.data)
7260  * elif self.free_data:
7261  * if self.dtype_is_object: # <<<<<<<<<<<<<<
7262  * refcount_objects_in_slice(self.data, self._shape,
7263  * self._strides, self.ndim, False)
7264  */
7265  }
7266 
7267  /* "View.MemoryView":219
7268  * refcount_objects_in_slice(self.data, self._shape,
7269  * self._strides, self.ndim, False)
7270  * free(self.data) # <<<<<<<<<<<<<<
7271  * PyObject_Free(self._shape)
7272  *
7273  */
7274  __Pyx_TraceLine(219,0,__PYX_ERR(2, 219, __pyx_L1_error))
7275  free(__pyx_v_self->data);
7276 
7277  /* "View.MemoryView":215
7278  * if self.callback_free_data != NULL:
7279  * self.callback_free_data(self.data)
7280  * elif self.free_data: # <<<<<<<<<<<<<<
7281  * if self.dtype_is_object:
7282  * refcount_objects_in_slice(self.data, self._shape,
7283  */
7284  }
7285  __pyx_L3:;
7286 
7287  /* "View.MemoryView":220
7288  * self._strides, self.ndim, False)
7289  * free(self.data)
7290  * PyObject_Free(self._shape) # <<<<<<<<<<<<<<
7291  *
7292  * @property
7293  */
7294  __Pyx_TraceLine(220,0,__PYX_ERR(2, 220, __pyx_L1_error))
7295  PyObject_Free(__pyx_v_self->_shape);
7296 
7297  /* "View.MemoryView":212
7298  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
7299  *
7300  * def __dealloc__(array self): # <<<<<<<<<<<<<<
7301  * if self.callback_free_data != NULL:
7302  * self.callback_free_data(self.data)
7303  */
7304 
7305  /* function exit code */
7306  goto __pyx_L0;
7307  __pyx_L1_error:;
7308  __Pyx_WriteUnraisable("View.MemoryView.array.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
7309  __pyx_L0:;
7310  __Pyx_TraceReturn(Py_None, 0);
7311  __Pyx_RefNannyFinishContext();
7312 }
7313 
7314 /* "View.MemoryView":223
7315  *
7316  * @property
7317  * def memview(self): # <<<<<<<<<<<<<<
7318  * return self.get_memview()
7319  *
7320  */
7321 
7322 /* Python wrapper */
7323 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
7324 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
7325  PyObject *__pyx_r = 0;
7326  __Pyx_RefNannyDeclarations
7327  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
7328  __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
7329 
7330  /* function exit code */
7331  __Pyx_RefNannyFinishContext();
7332  return __pyx_r;
7333 }
7334 
7335 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
7336  PyObject *__pyx_r = NULL;
7337  __Pyx_TraceDeclarations
7338  __Pyx_RefNannyDeclarations
7339  PyObject *__pyx_t_1 = NULL;
7340  int __pyx_lineno = 0;
7341  const char *__pyx_filename = NULL;
7342  int __pyx_clineno = 0;
7343  __Pyx_RefNannySetupContext("__get__", 0);
7344  __Pyx_TraceCall("__get__", __pyx_f[2], 223, 0, __PYX_ERR(2, 223, __pyx_L1_error));
7345 
7346  /* "View.MemoryView":224
7347  * @property
7348  * def memview(self):
7349  * return self.get_memview() # <<<<<<<<<<<<<<
7350  *
7351  * @cname('get_memview')
7352  */
7353  __Pyx_TraceLine(224,0,__PYX_ERR(2, 224, __pyx_L1_error))
7354  __Pyx_XDECREF(__pyx_r);
7355  __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 224, __pyx_L1_error)
7356  __Pyx_GOTREF(__pyx_t_1);
7357  __pyx_r = __pyx_t_1;
7358  __pyx_t_1 = 0;
7359  goto __pyx_L0;
7360 
7361  /* "View.MemoryView":223
7362  *
7363  * @property
7364  * def memview(self): # <<<<<<<<<<<<<<
7365  * return self.get_memview()
7366  *
7367  */
7368 
7369  /* function exit code */
7370  __pyx_L1_error:;
7371  __Pyx_XDECREF(__pyx_t_1);
7372  __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7373  __pyx_r = NULL;
7374  __pyx_L0:;
7375  __Pyx_XGIVEREF(__pyx_r);
7376  __Pyx_TraceReturn(__pyx_r, 0);
7377  __Pyx_RefNannyFinishContext();
7378  return __pyx_r;
7379 }
7380 
7381 /* "View.MemoryView":227
7382  *
7383  * @cname('get_memview')
7384  * cdef get_memview(self): # <<<<<<<<<<<<<<
7385  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
7386  * return memoryview(self, flags, self.dtype_is_object)
7387  */
7388 
7389 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
7390  int __pyx_v_flags;
7391  PyObject *__pyx_r = NULL;
7392  __Pyx_TraceDeclarations
7393  __Pyx_RefNannyDeclarations
7394  PyObject *__pyx_t_1 = NULL;
7395  PyObject *__pyx_t_2 = NULL;
7396  PyObject *__pyx_t_3 = NULL;
7397  int __pyx_lineno = 0;
7398  const char *__pyx_filename = NULL;
7399  int __pyx_clineno = 0;
7400  __Pyx_RefNannySetupContext("get_memview", 0);
7401  __Pyx_TraceCall("get_memview", __pyx_f[2], 227, 0, __PYX_ERR(2, 227, __pyx_L1_error));
7402 
7403  /* "View.MemoryView":228
7404  * @cname('get_memview')
7405  * cdef get_memview(self):
7406  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<<
7407  * return memoryview(self, flags, self.dtype_is_object)
7408  *
7409  */
7410  __Pyx_TraceLine(228,0,__PYX_ERR(2, 228, __pyx_L1_error))
7411  __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
7412 
7413  /* "View.MemoryView":229
7414  * cdef get_memview(self):
7415  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
7416  * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<<
7417  *
7418  * def __len__(self):
7419  */
7420  __Pyx_TraceLine(229,0,__PYX_ERR(2, 229, __pyx_L1_error))
7421  __Pyx_XDECREF(__pyx_r);
7422  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 229, __pyx_L1_error)
7423  __Pyx_GOTREF(__pyx_t_1);
7424  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 229, __pyx_L1_error)
7425  __Pyx_GOTREF(__pyx_t_2);
7426  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 229, __pyx_L1_error)
7427  __Pyx_GOTREF(__pyx_t_3);
7428  __Pyx_INCREF(((PyObject *)__pyx_v_self));
7429  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
7430  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
7431  __Pyx_GIVEREF(__pyx_t_1);
7432  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
7433  __Pyx_GIVEREF(__pyx_t_2);
7434  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
7435  __pyx_t_1 = 0;
7436  __pyx_t_2 = 0;
7437  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 229, __pyx_L1_error)
7438  __Pyx_GOTREF(__pyx_t_2);
7439  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7440  __pyx_r = __pyx_t_2;
7441  __pyx_t_2 = 0;
7442  goto __pyx_L0;
7443 
7444  /* "View.MemoryView":227
7445  *
7446  * @cname('get_memview')
7447  * cdef get_memview(self): # <<<<<<<<<<<<<<
7448  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
7449  * return memoryview(self, flags, self.dtype_is_object)
7450  */
7451 
7452  /* function exit code */
7453  __pyx_L1_error:;
7454  __Pyx_XDECREF(__pyx_t_1);
7455  __Pyx_XDECREF(__pyx_t_2);
7456  __Pyx_XDECREF(__pyx_t_3);
7457  __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
7458  __pyx_r = 0;
7459  __pyx_L0:;
7460  __Pyx_XGIVEREF(__pyx_r);
7461  __Pyx_TraceReturn(__pyx_r, 0);
7462  __Pyx_RefNannyFinishContext();
7463  return __pyx_r;
7464 }
7465 
7466 /* "View.MemoryView":231
7467  * return memoryview(self, flags, self.dtype_is_object)
7468  *
7469  * def __len__(self): # <<<<<<<<<<<<<<
7470  * return self._shape[0]
7471  *
7472  */
7473 
7474 /* Python wrapper */
7475 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/
7476 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
7477  Py_ssize_t __pyx_r;
7478  __Pyx_RefNannyDeclarations
7479  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
7480  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self));
7481 
7482  /* function exit code */
7483  __Pyx_RefNannyFinishContext();
7484  return __pyx_r;
7485 }
7486 
7487 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) {
7488  Py_ssize_t __pyx_r;
7489  __Pyx_TraceDeclarations
7490  __Pyx_RefNannyDeclarations
7491  int __pyx_lineno = 0;
7492  const char *__pyx_filename = NULL;
7493  int __pyx_clineno = 0;
7494  __Pyx_RefNannySetupContext("__len__", 0);
7495  __Pyx_TraceCall("__len__", __pyx_f[2], 231, 0, __PYX_ERR(2, 231, __pyx_L1_error));
7496 
7497  /* "View.MemoryView":232
7498  *
7499  * def __len__(self):
7500  * return self._shape[0] # <<<<<<<<<<<<<<
7501  *
7502  * def __getattr__(self, attr):
7503  */
7504  __Pyx_TraceLine(232,0,__PYX_ERR(2, 232, __pyx_L1_error))
7505  __pyx_r = (__pyx_v_self->_shape[0]);
7506  goto __pyx_L0;
7507 
7508  /* "View.MemoryView":231
7509  * return memoryview(self, flags, self.dtype_is_object)
7510  *
7511  * def __len__(self): # <<<<<<<<<<<<<<
7512  * return self._shape[0]
7513  *
7514  */
7515 
7516  /* function exit code */
7517  __pyx_L1_error:;
7518  __Pyx_AddTraceback("View.MemoryView.array.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7519  __pyx_r = -1;
7520  __pyx_L0:;
7521  __Pyx_TraceReturn(Py_None, 0);
7522  __Pyx_RefNannyFinishContext();
7523  return __pyx_r;
7524 }
7525 
7526 /* "View.MemoryView":234
7527  * return self._shape[0]
7528  *
7529  * def __getattr__(self, attr): # <<<<<<<<<<<<<<
7530  * return getattr(self.memview, attr)
7531  *
7532  */
7533 
7534 /* Python wrapper */
7535 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
7536 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
7537  PyObject *__pyx_r = 0;
7538  __Pyx_RefNannyDeclarations
7539  __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
7540  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
7541 
7542  /* function exit code */
7543  __Pyx_RefNannyFinishContext();
7544  return __pyx_r;
7545 }
7546 
7547 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
7548  PyObject *__pyx_r = NULL;
7549  __Pyx_TraceDeclarations
7550  __Pyx_RefNannyDeclarations
7551  PyObject *__pyx_t_1 = NULL;
7552  PyObject *__pyx_t_2 = NULL;
7553  int __pyx_lineno = 0;
7554  const char *__pyx_filename = NULL;
7555  int __pyx_clineno = 0;
7556  __Pyx_RefNannySetupContext("__getattr__", 0);
7557  __Pyx_TraceCall("__getattr__", __pyx_f[2], 234, 0, __PYX_ERR(2, 234, __pyx_L1_error));
7558 
7559  /* "View.MemoryView":235
7560  *
7561  * def __getattr__(self, attr):
7562  * return getattr(self.memview, attr) # <<<<<<<<<<<<<<
7563  *
7564  * def __getitem__(self, item):
7565  */
7566  __Pyx_TraceLine(235,0,__PYX_ERR(2, 235, __pyx_L1_error))
7567  __Pyx_XDECREF(__pyx_r);
7568  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 235, __pyx_L1_error)
7569  __Pyx_GOTREF(__pyx_t_1);
7570  __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 235, __pyx_L1_error)
7571  __Pyx_GOTREF(__pyx_t_2);
7572  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7573  __pyx_r = __pyx_t_2;
7574  __pyx_t_2 = 0;
7575  goto __pyx_L0;
7576 
7577  /* "View.MemoryView":234
7578  * return self._shape[0]
7579  *
7580  * def __getattr__(self, attr): # <<<<<<<<<<<<<<
7581  * return getattr(self.memview, attr)
7582  *
7583  */
7584 
7585  /* function exit code */
7586  __pyx_L1_error:;
7587  __Pyx_XDECREF(__pyx_t_1);
7588  __Pyx_XDECREF(__pyx_t_2);
7589  __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7590  __pyx_r = NULL;
7591  __pyx_L0:;
7592  __Pyx_XGIVEREF(__pyx_r);
7593  __Pyx_TraceReturn(__pyx_r, 0);
7594  __Pyx_RefNannyFinishContext();
7595  return __pyx_r;
7596 }
7597 
7598 /* "View.MemoryView":237
7599  * return getattr(self.memview, attr)
7600  *
7601  * def __getitem__(self, item): # <<<<<<<<<<<<<<
7602  * return self.memview[item]
7603  *
7604  */
7605 
7606 /* Python wrapper */
7607 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
7608 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
7609  PyObject *__pyx_r = 0;
7610  __Pyx_RefNannyDeclarations
7611  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
7612  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
7613 
7614  /* function exit code */
7615  __Pyx_RefNannyFinishContext();
7616  return __pyx_r;
7617 }
7618 
7619 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
7620  PyObject *__pyx_r = NULL;
7621  __Pyx_TraceDeclarations
7622  __Pyx_RefNannyDeclarations
7623  PyObject *__pyx_t_1 = NULL;
7624  PyObject *__pyx_t_2 = NULL;
7625  int __pyx_lineno = 0;
7626  const char *__pyx_filename = NULL;
7627  int __pyx_clineno = 0;
7628  __Pyx_RefNannySetupContext("__getitem__", 0);
7629  __Pyx_TraceCall("__getitem__", __pyx_f[2], 237, 0, __PYX_ERR(2, 237, __pyx_L1_error));
7630 
7631  /* "View.MemoryView":238
7632  *
7633  * def __getitem__(self, item):
7634  * return self.memview[item] # <<<<<<<<<<<<<<
7635  *
7636  * def __setitem__(self, item, value):
7637  */
7638  __Pyx_TraceLine(238,0,__PYX_ERR(2, 238, __pyx_L1_error))
7639  __Pyx_XDECREF(__pyx_r);
7640  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 238, __pyx_L1_error)
7641  __Pyx_GOTREF(__pyx_t_1);
7642  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 238, __pyx_L1_error)
7643  __Pyx_GOTREF(__pyx_t_2);
7644  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7645  __pyx_r = __pyx_t_2;
7646  __pyx_t_2 = 0;
7647  goto __pyx_L0;
7648 
7649  /* "View.MemoryView":237
7650  * return getattr(self.memview, attr)
7651  *
7652  * def __getitem__(self, item): # <<<<<<<<<<<<<<
7653  * return self.memview[item]
7654  *
7655  */
7656 
7657  /* function exit code */
7658  __pyx_L1_error:;
7659  __Pyx_XDECREF(__pyx_t_1);
7660  __Pyx_XDECREF(__pyx_t_2);
7661  __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7662  __pyx_r = NULL;
7663  __pyx_L0:;
7664  __Pyx_XGIVEREF(__pyx_r);
7665  __Pyx_TraceReturn(__pyx_r, 0);
7666  __Pyx_RefNannyFinishContext();
7667  return __pyx_r;
7668 }
7669 
7670 /* "View.MemoryView":240
7671  * return self.memview[item]
7672  *
7673  * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
7674  * self.memview[item] = value
7675  *
7676  */
7677 
7678 /* Python wrapper */
7679 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/
7680 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
7681  int __pyx_r;
7682  __Pyx_RefNannyDeclarations
7683  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
7684  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
7685 
7686  /* function exit code */
7687  __Pyx_RefNannyFinishContext();
7688  return __pyx_r;
7689 }
7690 
7691 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
7692  int __pyx_r;
7693  __Pyx_TraceDeclarations
7694  __Pyx_RefNannyDeclarations
7695  PyObject *__pyx_t_1 = NULL;
7696  int __pyx_lineno = 0;
7697  const char *__pyx_filename = NULL;
7698  int __pyx_clineno = 0;
7699  __Pyx_RefNannySetupContext("__setitem__", 0);
7700  __Pyx_TraceCall("__setitem__", __pyx_f[2], 240, 0, __PYX_ERR(2, 240, __pyx_L1_error));
7701 
7702  /* "View.MemoryView":241
7703  *
7704  * def __setitem__(self, item, value):
7705  * self.memview[item] = value # <<<<<<<<<<<<<<
7706  *
7707  *
7708  */
7709  __Pyx_TraceLine(241,0,__PYX_ERR(2, 241, __pyx_L1_error))
7710  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 241, __pyx_L1_error)
7711  __Pyx_GOTREF(__pyx_t_1);
7712  if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(2, 241, __pyx_L1_error)
7713  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7714 
7715  /* "View.MemoryView":240
7716  * return self.memview[item]
7717  *
7718  * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
7719  * self.memview[item] = value
7720  *
7721  */
7722 
7723  /* function exit code */
7724  __pyx_r = 0;
7725  goto __pyx_L0;
7726  __pyx_L1_error:;
7727  __Pyx_XDECREF(__pyx_t_1);
7728  __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7729  __pyx_r = -1;
7730  __pyx_L0:;
7731  __Pyx_TraceReturn(Py_None, 0);
7732  __Pyx_RefNannyFinishContext();
7733  return __pyx_r;
7734 }
7735 
7736 /* "(tree fragment)":1
7737  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
7738  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
7739  * def __setstate_cython__(self, __pyx_state):
7740  */
7741 
7742 /* Python wrapper */
7743 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
7744 static PyMethodDef __pyx_mdef___pyx_array_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0};
7745 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
7746  PyObject *__pyx_r = 0;
7747  __Pyx_RefNannyDeclarations
7748  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
7749  __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self));
7750 
7751  /* function exit code */
7752  __Pyx_RefNannyFinishContext();
7753  return __pyx_r;
7754 }
7755 
7756 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) {
7757  PyObject *__pyx_r = NULL;
7758  __Pyx_TraceDeclarations
7759  __Pyx_RefNannyDeclarations
7760  PyObject *__pyx_t_1 = NULL;
7761  int __pyx_lineno = 0;
7762  const char *__pyx_filename = NULL;
7763  int __pyx_clineno = 0;
7764  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
7765  __Pyx_TraceCall("__reduce_cython__", __pyx_f[2], 1, 0, __PYX_ERR(2, 1, __pyx_L1_error));
7766 
7767  /* "(tree fragment)":2
7768  * def __reduce_cython__(self):
7769  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
7770  * def __setstate_cython__(self, __pyx_state):
7771  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
7772  */
7773  __Pyx_TraceLine(2,0,__PYX_ERR(2, 2, __pyx_L1_error))
7774  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2, __pyx_L1_error)
7775  __Pyx_GOTREF(__pyx_t_1);
7776  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
7777  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7778  __PYX_ERR(2, 2, __pyx_L1_error)
7779 
7780  /* "(tree fragment)":1
7781  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
7782  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
7783  * def __setstate_cython__(self, __pyx_state):
7784  */
7785 
7786  /* function exit code */
7787  __pyx_L1_error:;
7788  __Pyx_XDECREF(__pyx_t_1);
7789  __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7790  __pyx_r = NULL;
7791  __Pyx_XGIVEREF(__pyx_r);
7792  __Pyx_TraceReturn(__pyx_r, 0);
7793  __Pyx_RefNannyFinishContext();
7794  return __pyx_r;
7795 }
7796 
7797 /* "(tree fragment)":3
7798  * def __reduce_cython__(self):
7799  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
7800  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
7801  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
7802  */
7803 
7804 /* Python wrapper */
7805 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
7806 static PyMethodDef __pyx_mdef___pyx_array_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0};
7807 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
7808  PyObject *__pyx_r = 0;
7809  __Pyx_RefNannyDeclarations
7810  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
7811  __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
7812 
7813  /* function exit code */
7814  __Pyx_RefNannyFinishContext();
7815  return __pyx_r;
7816 }
7817 
7818 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
7819  PyObject *__pyx_r = NULL;
7820  __Pyx_TraceDeclarations
7821  __Pyx_RefNannyDeclarations
7822  PyObject *__pyx_t_1 = NULL;
7823  int __pyx_lineno = 0;
7824  const char *__pyx_filename = NULL;
7825  int __pyx_clineno = 0;
7826  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
7827  __Pyx_TraceCall("__setstate_cython__", __pyx_f[2], 3, 0, __PYX_ERR(2, 3, __pyx_L1_error));
7828 
7829  /* "(tree fragment)":4
7830  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
7831  * def __setstate_cython__(self, __pyx_state):
7832  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
7833  */
7834  __Pyx_TraceLine(4,0,__PYX_ERR(2, 4, __pyx_L1_error))
7835  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error)
7836  __Pyx_GOTREF(__pyx_t_1);
7837  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
7838  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7839  __PYX_ERR(2, 4, __pyx_L1_error)
7840 
7841  /* "(tree fragment)":3
7842  * def __reduce_cython__(self):
7843  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
7844  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
7845  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
7846  */
7847 
7848  /* function exit code */
7849  __pyx_L1_error:;
7850  __Pyx_XDECREF(__pyx_t_1);
7851  __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7852  __pyx_r = NULL;
7853  __Pyx_XGIVEREF(__pyx_r);
7854  __Pyx_TraceReturn(__pyx_r, 0);
7855  __Pyx_RefNannyFinishContext();
7856  return __pyx_r;
7857 }
7858 
7859 /* "View.MemoryView":245
7860  *
7861  * @cname("__pyx_array_new")
7862  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
7863  * char *mode, char *buf):
7864  * cdef array result
7865  */
7866 
7867 static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char *__pyx_v_mode, char *__pyx_v_buf) {
7868  struct __pyx_array_obj *__pyx_v_result = 0;
7869  struct __pyx_array_obj *__pyx_r = NULL;
7870  __Pyx_TraceDeclarations
7871  __Pyx_RefNannyDeclarations
7872  int __pyx_t_1;
7873  PyObject *__pyx_t_2 = NULL;
7874  PyObject *__pyx_t_3 = NULL;
7875  PyObject *__pyx_t_4 = NULL;
7876  PyObject *__pyx_t_5 = NULL;
7877  int __pyx_lineno = 0;
7878  const char *__pyx_filename = NULL;
7879  int __pyx_clineno = 0;
7880  __Pyx_RefNannySetupContext("array_cwrapper", 0);
7881  __Pyx_TraceCall("array_cwrapper", __pyx_f[2], 245, 0, __PYX_ERR(2, 245, __pyx_L1_error));
7882 
7883  /* "View.MemoryView":249
7884  * cdef array result
7885  *
7886  * if buf == NULL: # <<<<<<<<<<<<<<
7887  * result = array(shape, itemsize, format, mode.decode('ASCII'))
7888  * else:
7889  */
7890  __Pyx_TraceLine(249,0,__PYX_ERR(2, 249, __pyx_L1_error))
7891  __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
7892  if (__pyx_t_1) {
7893 
7894  /* "View.MemoryView":250
7895  *
7896  * if buf == NULL:
7897  * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<<
7898  * else:
7899  * result = array(shape, itemsize, format, mode.decode('ASCII'),
7900  */
7901  __Pyx_TraceLine(250,0,__PYX_ERR(2, 250, __pyx_L1_error))
7902  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 250, __pyx_L1_error)
7903  __Pyx_GOTREF(__pyx_t_2);
7904  __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 250, __pyx_L1_error)
7905  __Pyx_GOTREF(__pyx_t_3);
7906  __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 250, __pyx_L1_error)
7907  __Pyx_GOTREF(__pyx_t_4);
7908  __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 250, __pyx_L1_error)
7909  __Pyx_GOTREF(__pyx_t_5);
7910  __Pyx_INCREF(__pyx_v_shape);
7911  __Pyx_GIVEREF(__pyx_v_shape);
7912  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
7913  __Pyx_GIVEREF(__pyx_t_2);
7914  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
7915  __Pyx_GIVEREF(__pyx_t_3);
7916  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
7917  __Pyx_GIVEREF(__pyx_t_4);
7918  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
7919  __pyx_t_2 = 0;
7920  __pyx_t_3 = 0;
7921  __pyx_t_4 = 0;
7922  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 250, __pyx_L1_error)
7923  __Pyx_GOTREF(__pyx_t_4);
7924  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7925  __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4);
7926  __pyx_t_4 = 0;
7927 
7928  /* "View.MemoryView":249
7929  * cdef array result
7930  *
7931  * if buf == NULL: # <<<<<<<<<<<<<<
7932  * result = array(shape, itemsize, format, mode.decode('ASCII'))
7933  * else:
7934  */
7935  goto __pyx_L3;
7936  }
7937 
7938  /* "View.MemoryView":252
7939  * result = array(shape, itemsize, format, mode.decode('ASCII'))
7940  * else:
7941  * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
7942  * allocate_buffer=False)
7943  * result.data = buf
7944  */
7945  __Pyx_TraceLine(252,0,__PYX_ERR(2, 252, __pyx_L1_error))
7946  /*else*/ {
7947  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 252, __pyx_L1_error)
7948  __Pyx_GOTREF(__pyx_t_4);
7949  __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 252, __pyx_L1_error)
7950  __Pyx_GOTREF(__pyx_t_5);
7951  __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 252, __pyx_L1_error)
7952  __Pyx_GOTREF(__pyx_t_3);
7953  __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 252, __pyx_L1_error)
7954  __Pyx_GOTREF(__pyx_t_2);
7955  __Pyx_INCREF(__pyx_v_shape);
7956  __Pyx_GIVEREF(__pyx_v_shape);
7957  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
7958  __Pyx_GIVEREF(__pyx_t_4);
7959  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
7960  __Pyx_GIVEREF(__pyx_t_5);
7961  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
7962  __Pyx_GIVEREF(__pyx_t_3);
7963  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
7964  __pyx_t_4 = 0;
7965  __pyx_t_5 = 0;
7966  __pyx_t_3 = 0;
7967 
7968  /* "View.MemoryView":253
7969  * else:
7970  * result = array(shape, itemsize, format, mode.decode('ASCII'),
7971  * allocate_buffer=False) # <<<<<<<<<<<<<<
7972  * result.data = buf
7973  *
7974  */
7975  __Pyx_TraceLine(253,0,__PYX_ERR(2, 253, __pyx_L1_error))
7976  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 253, __pyx_L1_error)
7977  __Pyx_GOTREF(__pyx_t_3);
7978  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(2, 253, __pyx_L1_error)
7979 
7980  /* "View.MemoryView":252
7981  * result = array(shape, itemsize, format, mode.decode('ASCII'))
7982  * else:
7983  * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
7984  * allocate_buffer=False)
7985  * result.data = buf
7986  */
7987  __Pyx_TraceLine(252,0,__PYX_ERR(2, 252, __pyx_L1_error))
7988  __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 252, __pyx_L1_error)
7989  __Pyx_GOTREF(__pyx_t_5);
7990  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7991  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7992  __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5);
7993  __pyx_t_5 = 0;
7994 
7995  /* "View.MemoryView":254
7996  * result = array(shape, itemsize, format, mode.decode('ASCII'),
7997  * allocate_buffer=False)
7998  * result.data = buf # <<<<<<<<<<<<<<
7999  *
8000  * return result
8001  */
8002  __Pyx_TraceLine(254,0,__PYX_ERR(2, 254, __pyx_L1_error))
8003  __pyx_v_result->data = __pyx_v_buf;
8004  }
8005  __pyx_L3:;
8006 
8007  /* "View.MemoryView":256
8008  * result.data = buf
8009  *
8010  * return result # <<<<<<<<<<<<<<
8011  *
8012  *
8013  */
8014  __Pyx_TraceLine(256,0,__PYX_ERR(2, 256, __pyx_L1_error))
8015  __Pyx_XDECREF(((PyObject *)__pyx_r));
8016  __Pyx_INCREF(((PyObject *)__pyx_v_result));
8017  __pyx_r = __pyx_v_result;
8018  goto __pyx_L0;
8019 
8020  /* "View.MemoryView":245
8021  *
8022  * @cname("__pyx_array_new")
8023  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
8024  * char *mode, char *buf):
8025  * cdef array result
8026  */
8027 
8028  /* function exit code */
8029  __pyx_L1_error:;
8030  __Pyx_XDECREF(__pyx_t_2);
8031  __Pyx_XDECREF(__pyx_t_3);
8032  __Pyx_XDECREF(__pyx_t_4);
8033  __Pyx_XDECREF(__pyx_t_5);
8034  __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
8035  __pyx_r = 0;
8036  __pyx_L0:;
8037  __Pyx_XDECREF((PyObject *)__pyx_v_result);
8038  __Pyx_XGIVEREF((PyObject *)__pyx_r);
8039  __Pyx_TraceReturn(__pyx_r, 0);
8040  __Pyx_RefNannyFinishContext();
8041  return __pyx_r;
8042 }
8043 
8044 /* "View.MemoryView":282
8045  * cdef class Enum(object):
8046  * cdef object name
8047  * def __init__(self, name): # <<<<<<<<<<<<<<
8048  * self.name = name
8049  * def __repr__(self):
8050  */
8051 
8052 /* Python wrapper */
8053 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
8054 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8055  PyObject *__pyx_v_name = 0;
8056  int __pyx_lineno = 0;
8057  const char *__pyx_filename = NULL;
8058  int __pyx_clineno = 0;
8059  int __pyx_r;
8060  __Pyx_RefNannyDeclarations
8061  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
8062  {
8063  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
8064  PyObject* values[1] = {0};
8065  if (unlikely(__pyx_kwds)) {
8066  Py_ssize_t kw_args;
8067  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8068  switch (pos_args) {
8069  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8070  CYTHON_FALLTHROUGH;
8071  case 0: break;
8072  default: goto __pyx_L5_argtuple_error;
8073  }
8074  kw_args = PyDict_Size(__pyx_kwds);
8075  switch (pos_args) {
8076  case 0:
8077  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
8078  else goto __pyx_L5_argtuple_error;
8079  }
8080  if (unlikely(kw_args > 0)) {
8081  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(2, 282, __pyx_L3_error)
8082  }
8083  } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
8084  goto __pyx_L5_argtuple_error;
8085  } else {
8086  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8087  }
8088  __pyx_v_name = values[0];
8089  }
8090  goto __pyx_L4_argument_unpacking_done;
8091  __pyx_L5_argtuple_error:;
8092  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 282, __pyx_L3_error)
8093  __pyx_L3_error:;
8094  __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8095  __Pyx_RefNannyFinishContext();
8096  return -1;
8097  __pyx_L4_argument_unpacking_done:;
8098  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
8099 
8100  /* function exit code */
8101  __Pyx_RefNannyFinishContext();
8102  return __pyx_r;
8103 }
8104 
8105 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
8106  int __pyx_r;
8107  __Pyx_TraceDeclarations
8108  __Pyx_RefNannyDeclarations
8109  int __pyx_lineno = 0;
8110  const char *__pyx_filename = NULL;
8111  int __pyx_clineno = 0;
8112  __Pyx_RefNannySetupContext("__init__", 0);
8113  __Pyx_TraceCall("__init__", __pyx_f[2], 282, 0, __PYX_ERR(2, 282, __pyx_L1_error));
8114 
8115  /* "View.MemoryView":283
8116  * cdef object name
8117  * def __init__(self, name):
8118  * self.name = name # <<<<<<<<<<<<<<
8119  * def __repr__(self):
8120  * return self.name
8121  */
8122  __Pyx_TraceLine(283,0,__PYX_ERR(2, 283, __pyx_L1_error))
8123  __Pyx_INCREF(__pyx_v_name);
8124  __Pyx_GIVEREF(__pyx_v_name);
8125  __Pyx_GOTREF(__pyx_v_self->name);
8126  __Pyx_DECREF(__pyx_v_self->name);
8127  __pyx_v_self->name = __pyx_v_name;
8128 
8129  /* "View.MemoryView":282
8130  * cdef class Enum(object):
8131  * cdef object name
8132  * def __init__(self, name): # <<<<<<<<<<<<<<
8133  * self.name = name
8134  * def __repr__(self):
8135  */
8136 
8137  /* function exit code */
8138  __pyx_r = 0;
8139  goto __pyx_L0;
8140  __pyx_L1_error:;
8141  __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8142  __pyx_r = -1;
8143  __pyx_L0:;
8144  __Pyx_TraceReturn(Py_None, 0);
8145  __Pyx_RefNannyFinishContext();
8146  return __pyx_r;
8147 }
8148 
8149 /* "View.MemoryView":284
8150  * def __init__(self, name):
8151  * self.name = name
8152  * def __repr__(self): # <<<<<<<<<<<<<<
8153  * return self.name
8154  *
8155  */
8156 
8157 /* Python wrapper */
8158 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
8159 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
8160  PyObject *__pyx_r = 0;
8161  __Pyx_RefNannyDeclarations
8162  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
8163  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
8164 
8165  /* function exit code */
8166  __Pyx_RefNannyFinishContext();
8167  return __pyx_r;
8168 }
8169 
8170 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
8171  PyObject *__pyx_r = NULL;
8172  __Pyx_TraceDeclarations
8173  __Pyx_RefNannyDeclarations
8174  int __pyx_lineno = 0;
8175  const char *__pyx_filename = NULL;
8176  int __pyx_clineno = 0;
8177  __Pyx_RefNannySetupContext("__repr__", 0);
8178  __Pyx_TraceCall("__repr__", __pyx_f[2], 284, 0, __PYX_ERR(2, 284, __pyx_L1_error));
8179 
8180  /* "View.MemoryView":285
8181  * self.name = name
8182  * def __repr__(self):
8183  * return self.name # <<<<<<<<<<<<<<
8184  *
8185  * cdef generic = Enum("<strided and direct or indirect>")
8186  */
8187  __Pyx_TraceLine(285,0,__PYX_ERR(2, 285, __pyx_L1_error))
8188  __Pyx_XDECREF(__pyx_r);
8189  __Pyx_INCREF(__pyx_v_self->name);
8190  __pyx_r = __pyx_v_self->name;
8191  goto __pyx_L0;
8192 
8193  /* "View.MemoryView":284
8194  * def __init__(self, name):
8195  * self.name = name
8196  * def __repr__(self): # <<<<<<<<<<<<<<
8197  * return self.name
8198  *
8199  */
8200 
8201  /* function exit code */
8202  __pyx_L1_error:;
8203  __Pyx_AddTraceback("View.MemoryView.Enum.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8204  __pyx_r = NULL;
8205  __pyx_L0:;
8206  __Pyx_XGIVEREF(__pyx_r);
8207  __Pyx_TraceReturn(__pyx_r, 0);
8208  __Pyx_RefNannyFinishContext();
8209  return __pyx_r;
8210 }
8211 
8212 /* "(tree fragment)":1
8213  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
8214  * cdef tuple state
8215  * cdef object _dict
8216  */
8217 
8218 /* Python wrapper */
8219 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
8220 static PyMethodDef __pyx_mdef___pyx_MemviewEnum_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0};
8221 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
8222  PyObject *__pyx_r = 0;
8223  __Pyx_RefNannyDeclarations
8224  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
8225  __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
8226 
8227  /* function exit code */
8228  __Pyx_RefNannyFinishContext();
8229  return __pyx_r;
8230 }
8231 
8232 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
8233  PyObject *__pyx_v_state = 0;
8234  PyObject *__pyx_v__dict = 0;
8235  int __pyx_v_use_setstate;
8236  PyObject *__pyx_r = NULL;
8237  __Pyx_TraceDeclarations
8238  __Pyx_RefNannyDeclarations
8239  PyObject *__pyx_t_1 = NULL;
8240  int __pyx_t_2;
8241  int __pyx_t_3;
8242  PyObject *__pyx_t_4 = NULL;
8243  PyObject *__pyx_t_5 = NULL;
8244  int __pyx_lineno = 0;
8245  const char *__pyx_filename = NULL;
8246  int __pyx_clineno = 0;
8247  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
8248  __Pyx_TraceCall("__reduce_cython__", __pyx_f[2], 1, 0, __PYX_ERR(2, 1, __pyx_L1_error));
8249 
8250  /* "(tree fragment)":5
8251  * cdef object _dict
8252  * cdef bint use_setstate
8253  * state = (self.name,) # <<<<<<<<<<<<<<
8254  * _dict = getattr(self, '__dict__', None)
8255  * if _dict is not None:
8256  */
8257  __Pyx_TraceLine(5,0,__PYX_ERR(2, 5, __pyx_L1_error))
8258  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
8259  __Pyx_GOTREF(__pyx_t_1);
8260  __Pyx_INCREF(__pyx_v_self->name);
8261  __Pyx_GIVEREF(__pyx_v_self->name);
8262  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
8263  __pyx_v_state = ((PyObject*)__pyx_t_1);
8264  __pyx_t_1 = 0;
8265 
8266  /* "(tree fragment)":6
8267  * cdef bint use_setstate
8268  * state = (self.name,)
8269  * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
8270  * if _dict is not None:
8271  * state += (_dict,)
8272  */
8273  __Pyx_TraceLine(6,0,__PYX_ERR(2, 6, __pyx_L1_error))
8274  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 6, __pyx_L1_error)
8275  __Pyx_GOTREF(__pyx_t_1);
8276  __pyx_v__dict = __pyx_t_1;
8277  __pyx_t_1 = 0;
8278 
8279  /* "(tree fragment)":7
8280  * state = (self.name,)
8281  * _dict = getattr(self, '__dict__', None)
8282  * if _dict is not None: # <<<<<<<<<<<<<<
8283  * state += (_dict,)
8284  * use_setstate = True
8285  */
8286  __Pyx_TraceLine(7,0,__PYX_ERR(2, 7, __pyx_L1_error))
8287  __pyx_t_2 = (__pyx_v__dict != Py_None);
8288  __pyx_t_3 = (__pyx_t_2 != 0);
8289  if (__pyx_t_3) {
8290 
8291  /* "(tree fragment)":8
8292  * _dict = getattr(self, '__dict__', None)
8293  * if _dict is not None:
8294  * state += (_dict,) # <<<<<<<<<<<<<<
8295  * use_setstate = True
8296  * else:
8297  */
8298  __Pyx_TraceLine(8,0,__PYX_ERR(2, 8, __pyx_L1_error))
8299  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 8, __pyx_L1_error)
8300  __Pyx_GOTREF(__pyx_t_1);
8301  __Pyx_INCREF(__pyx_v__dict);
8302  __Pyx_GIVEREF(__pyx_v__dict);
8303  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
8304  __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 8, __pyx_L1_error)
8305  __Pyx_GOTREF(__pyx_t_4);
8306  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8307  __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
8308  __pyx_t_4 = 0;
8309 
8310  /* "(tree fragment)":9
8311  * if _dict is not None:
8312  * state += (_dict,)
8313  * use_setstate = True # <<<<<<<<<<<<<<
8314  * else:
8315  * use_setstate = self.name is not None
8316  */
8317  __Pyx_TraceLine(9,0,__PYX_ERR(2, 9, __pyx_L1_error))
8318  __pyx_v_use_setstate = 1;
8319 
8320  /* "(tree fragment)":7
8321  * state = (self.name,)
8322  * _dict = getattr(self, '__dict__', None)
8323  * if _dict is not None: # <<<<<<<<<<<<<<
8324  * state += (_dict,)
8325  * use_setstate = True
8326  */
8327  goto __pyx_L3;
8328  }
8329 
8330  /* "(tree fragment)":11
8331  * use_setstate = True
8332  * else:
8333  * use_setstate = self.name is not None # <<<<<<<<<<<<<<
8334  * if use_setstate:
8335  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
8336  */
8337  __Pyx_TraceLine(11,0,__PYX_ERR(2, 11, __pyx_L1_error))
8338  /*else*/ {
8339  __pyx_t_3 = (__pyx_v_self->name != Py_None);
8340  __pyx_v_use_setstate = __pyx_t_3;
8341  }
8342  __pyx_L3:;
8343 
8344  /* "(tree fragment)":12
8345  * else:
8346  * use_setstate = self.name is not None
8347  * if use_setstate: # <<<<<<<<<<<<<<
8348  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
8349  * else:
8350  */
8351  __Pyx_TraceLine(12,0,__PYX_ERR(2, 12, __pyx_L1_error))
8352  __pyx_t_3 = (__pyx_v_use_setstate != 0);
8353  if (__pyx_t_3) {
8354 
8355  /* "(tree fragment)":13
8356  * use_setstate = self.name is not None
8357  * if use_setstate:
8358  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state # <<<<<<<<<<<<<<
8359  * else:
8360  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
8361  */
8362  __Pyx_TraceLine(13,0,__PYX_ERR(2, 13, __pyx_L1_error))
8363  __Pyx_XDECREF(__pyx_r);
8364  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 13, __pyx_L1_error)
8365  __Pyx_GOTREF(__pyx_t_4);
8366  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 13, __pyx_L1_error)
8367  __Pyx_GOTREF(__pyx_t_1);
8368  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
8369  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
8370  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
8371  __Pyx_INCREF(__pyx_int_184977713);
8372  __Pyx_GIVEREF(__pyx_int_184977713);
8373  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
8374  __Pyx_INCREF(Py_None);
8375  __Pyx_GIVEREF(Py_None);
8376  PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
8377  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 13, __pyx_L1_error)
8378  __Pyx_GOTREF(__pyx_t_5);
8379  __Pyx_GIVEREF(__pyx_t_4);
8380  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
8381  __Pyx_GIVEREF(__pyx_t_1);
8382  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
8383  __Pyx_INCREF(__pyx_v_state);
8384  __Pyx_GIVEREF(__pyx_v_state);
8385  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
8386  __pyx_t_4 = 0;
8387  __pyx_t_1 = 0;
8388  __pyx_r = __pyx_t_5;
8389  __pyx_t_5 = 0;
8390  goto __pyx_L0;
8391 
8392  /* "(tree fragment)":12
8393  * else:
8394  * use_setstate = self.name is not None
8395  * if use_setstate: # <<<<<<<<<<<<<<
8396  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
8397  * else:
8398  */
8399  }
8400 
8401  /* "(tree fragment)":15
8402  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
8403  * else:
8404  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) # <<<<<<<<<<<<<<
8405  * def __setstate_cython__(self, __pyx_state):
8406  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
8407  */
8408  __Pyx_TraceLine(15,0,__PYX_ERR(2, 15, __pyx_L1_error))
8409  /*else*/ {
8410  __Pyx_XDECREF(__pyx_r);
8411  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 15, __pyx_L1_error)
8412  __Pyx_GOTREF(__pyx_t_5);
8413  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 15, __pyx_L1_error)
8414  __Pyx_GOTREF(__pyx_t_1);
8415  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
8416  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
8417  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
8418  __Pyx_INCREF(__pyx_int_184977713);
8419  __Pyx_GIVEREF(__pyx_int_184977713);
8420  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
8421  __Pyx_INCREF(__pyx_v_state);
8422  __Pyx_GIVEREF(__pyx_v_state);
8423  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
8424  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 15, __pyx_L1_error)
8425  __Pyx_GOTREF(__pyx_t_4);
8426  __Pyx_GIVEREF(__pyx_t_5);
8427  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
8428  __Pyx_GIVEREF(__pyx_t_1);
8429  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
8430  __pyx_t_5 = 0;
8431  __pyx_t_1 = 0;
8432  __pyx_r = __pyx_t_4;
8433  __pyx_t_4 = 0;
8434  goto __pyx_L0;
8435  }
8436 
8437  /* "(tree fragment)":1
8438  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
8439  * cdef tuple state
8440  * cdef object _dict
8441  */
8442 
8443  /* function exit code */
8444  __pyx_L1_error:;
8445  __Pyx_XDECREF(__pyx_t_1);
8446  __Pyx_XDECREF(__pyx_t_4);
8447  __Pyx_XDECREF(__pyx_t_5);
8448  __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8449  __pyx_r = NULL;
8450  __pyx_L0:;
8451  __Pyx_XDECREF(__pyx_v_state);
8452  __Pyx_XDECREF(__pyx_v__dict);
8453  __Pyx_XGIVEREF(__pyx_r);
8454  __Pyx_TraceReturn(__pyx_r, 0);
8455  __Pyx_RefNannyFinishContext();
8456  return __pyx_r;
8457 }
8458 
8459 /* "(tree fragment)":16
8460  * else:
8461  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
8462  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
8463  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
8464  */
8465 
8466 /* Python wrapper */
8467 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
8468 static PyMethodDef __pyx_mdef___pyx_MemviewEnum_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0};
8469 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
8470  PyObject *__pyx_r = 0;
8471  __Pyx_RefNannyDeclarations
8472  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
8473  __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
8474 
8475  /* function exit code */
8476  __Pyx_RefNannyFinishContext();
8477  return __pyx_r;
8478 }
8479 
8480 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
8481  PyObject *__pyx_r = NULL;
8482  __Pyx_TraceDeclarations
8483  __Pyx_RefNannyDeclarations
8484  PyObject *__pyx_t_1 = NULL;
8485  int __pyx_lineno = 0;
8486  const char *__pyx_filename = NULL;
8487  int __pyx_clineno = 0;
8488  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
8489  __Pyx_TraceCall("__setstate_cython__", __pyx_f[2], 16, 0, __PYX_ERR(2, 16, __pyx_L1_error));
8490 
8491  /* "(tree fragment)":17
8492  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
8493  * def __setstate_cython__(self, __pyx_state):
8494  * __pyx_unpickle_Enum__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
8495  */
8496  __Pyx_TraceLine(17,0,__PYX_ERR(2, 17, __pyx_L1_error))
8497  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||((void)PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 17, __pyx_L1_error)
8498  __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 17, __pyx_L1_error)
8499  __Pyx_GOTREF(__pyx_t_1);
8500  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8501 
8502  /* "(tree fragment)":16
8503  * else:
8504  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
8505  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
8506  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
8507  */
8508 
8509  /* function exit code */
8510  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8511  goto __pyx_L0;
8512  __pyx_L1_error:;
8513  __Pyx_XDECREF(__pyx_t_1);
8514  __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8515  __pyx_r = NULL;
8516  __pyx_L0:;
8517  __Pyx_XGIVEREF(__pyx_r);
8518  __Pyx_TraceReturn(__pyx_r, 0);
8519  __Pyx_RefNannyFinishContext();
8520  return __pyx_r;
8521 }
8522 
8523 /* "View.MemoryView":299
8524  *
8525  * @cname('__pyx_align_pointer')
8526  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
8527  * "Align pointer memory on a given boundary"
8528  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
8529  */
8530 
8531 static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) {
8532  Py_intptr_t __pyx_v_aligned_p;
8533  size_t __pyx_v_offset;
8534  void *__pyx_r;
8535  __Pyx_TraceDeclarations
8536  int __pyx_t_1;
8537  int __pyx_lineno = 0;
8538  const char *__pyx_filename = NULL;
8539  int __pyx_clineno = 0;
8540  __Pyx_TraceCall("align_pointer", __pyx_f[2], 299, 1, __PYX_ERR(2, 299, __pyx_L1_error));
8541 
8542  /* "View.MemoryView":301
8543  * cdef void *align_pointer(void *memory, size_t alignment) nogil:
8544  * "Align pointer memory on a given boundary"
8545  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory # <<<<<<<<<<<<<<
8546  * cdef size_t offset
8547  *
8548  */
8549  __Pyx_TraceLine(301,1,__PYX_ERR(2, 301, __pyx_L1_error))
8550  __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
8551 
8552  /* "View.MemoryView":305
8553  *
8554  * with cython.cdivision(True):
8555  * offset = aligned_p % alignment # <<<<<<<<<<<<<<
8556  *
8557  * if offset > 0:
8558  */
8559  __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
8560 
8561  /* "View.MemoryView":307
8562  * offset = aligned_p % alignment
8563  *
8564  * if offset > 0: # <<<<<<<<<<<<<<
8565  * aligned_p += alignment - offset
8566  *
8567  */
8568  __Pyx_TraceLine(307,1,__PYX_ERR(2, 307, __pyx_L1_error))
8569  __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
8570  if (__pyx_t_1) {
8571 
8572  /* "View.MemoryView":308
8573  *
8574  * if offset > 0:
8575  * aligned_p += alignment - offset # <<<<<<<<<<<<<<
8576  *
8577  * return <void *> aligned_p
8578  */
8579  __Pyx_TraceLine(308,1,__PYX_ERR(2, 308, __pyx_L1_error))
8580  __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
8581 
8582  /* "View.MemoryView":307
8583  * offset = aligned_p % alignment
8584  *
8585  * if offset > 0: # <<<<<<<<<<<<<<
8586  * aligned_p += alignment - offset
8587  *
8588  */
8589  }
8590 
8591  /* "View.MemoryView":310
8592  * aligned_p += alignment - offset
8593  *
8594  * return <void *> aligned_p # <<<<<<<<<<<<<<
8595  *
8596  *
8597  */
8598  __Pyx_TraceLine(310,1,__PYX_ERR(2, 310, __pyx_L1_error))
8599  __pyx_r = ((void *)__pyx_v_aligned_p);
8600  goto __pyx_L0;
8601 
8602  /* "View.MemoryView":299
8603  *
8604  * @cname('__pyx_align_pointer')
8605  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
8606  * "Align pointer memory on a given boundary"
8607  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
8608  */
8609 
8610  /* function exit code */
8611  __pyx_L1_error:;
8612  __Pyx_WriteUnraisable("View.MemoryView.align_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
8613  __pyx_r = 0;
8614  __pyx_L0:;
8615  __Pyx_TraceReturn(Py_None, 1);
8616  return __pyx_r;
8617 }
8618 
8619 /* "View.MemoryView":346
8620  * cdef __Pyx_TypeInfo *typeinfo
8621  *
8622  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
8623  * self.obj = obj
8624  * self.flags = flags
8625  */
8626 
8627 /* Python wrapper */
8628 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
8629 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8630  PyObject *__pyx_v_obj = 0;
8631  int __pyx_v_flags;
8632  int __pyx_v_dtype_is_object;
8633  int __pyx_lineno = 0;
8634  const char *__pyx_filename = NULL;
8635  int __pyx_clineno = 0;
8636  int __pyx_r;
8637  __Pyx_RefNannyDeclarations
8638  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
8639  {
8640  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
8641  PyObject* values[3] = {0,0,0};
8642  if (unlikely(__pyx_kwds)) {
8643  Py_ssize_t kw_args;
8644  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8645  switch (pos_args) {
8646  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8647  CYTHON_FALLTHROUGH;
8648  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8649  CYTHON_FALLTHROUGH;
8650  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8651  CYTHON_FALLTHROUGH;
8652  case 0: break;
8653  default: goto __pyx_L5_argtuple_error;
8654  }
8655  kw_args = PyDict_Size(__pyx_kwds);
8656  switch (pos_args) {
8657  case 0:
8658  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
8659  else goto __pyx_L5_argtuple_error;
8660  CYTHON_FALLTHROUGH;
8661  case 1:
8662  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
8663  else {
8664  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(2, 346, __pyx_L3_error)
8665  }
8666  CYTHON_FALLTHROUGH;
8667  case 2:
8668  if (kw_args > 0) {
8669  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
8670  if (value) { values[2] = value; kw_args--; }
8671  }
8672  }
8673  if (unlikely(kw_args > 0)) {
8674  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 346, __pyx_L3_error)
8675  }
8676  } else {
8677  switch (PyTuple_GET_SIZE(__pyx_args)) {
8678  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8679  CYTHON_FALLTHROUGH;
8680  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8681  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8682  break;
8683  default: goto __pyx_L5_argtuple_error;
8684  }
8685  }
8686  __pyx_v_obj = values[0];
8687  __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 346, __pyx_L3_error)
8688  if (values[2]) {
8689  __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 346, __pyx_L3_error)
8690  } else {
8691  __pyx_v_dtype_is_object = ((int)0);
8692  }
8693  }
8694  goto __pyx_L4_argument_unpacking_done;
8695  __pyx_L5_argtuple_error:;
8696  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 346, __pyx_L3_error)
8697  __pyx_L3_error:;
8698  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8699  __Pyx_RefNannyFinishContext();
8700  return -1;
8701  __pyx_L4_argument_unpacking_done:;
8702  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
8703 
8704  /* function exit code */
8705  __Pyx_RefNannyFinishContext();
8706  return __pyx_r;
8707 }
8708 
8709 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object) {
8710  int __pyx_r;
8711  __Pyx_TraceDeclarations
8712  __Pyx_RefNannyDeclarations
8713  int __pyx_t_1;
8714  int __pyx_t_2;
8715  int __pyx_t_3;
8716  int __pyx_t_4;
8717  int __pyx_lineno = 0;
8718  const char *__pyx_filename = NULL;
8719  int __pyx_clineno = 0;
8720  __Pyx_RefNannySetupContext("__cinit__", 0);
8721  __Pyx_TraceCall("__cinit__", __pyx_f[2], 346, 0, __PYX_ERR(2, 346, __pyx_L1_error));
8722 
8723  /* "View.MemoryView":347
8724  *
8725  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
8726  * self.obj = obj # <<<<<<<<<<<<<<
8727  * self.flags = flags
8728  * if type(self) is memoryview or obj is not None:
8729  */
8730  __Pyx_TraceLine(347,0,__PYX_ERR(2, 347, __pyx_L1_error))
8731  __Pyx_INCREF(__pyx_v_obj);
8732  __Pyx_GIVEREF(__pyx_v_obj);
8733  __Pyx_GOTREF(__pyx_v_self->obj);
8734  __Pyx_DECREF(__pyx_v_self->obj);
8735  __pyx_v_self->obj = __pyx_v_obj;
8736 
8737  /* "View.MemoryView":348
8738  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
8739  * self.obj = obj
8740  * self.flags = flags # <<<<<<<<<<<<<<
8741  * if type(self) is memoryview or obj is not None:
8742  * __Pyx_GetBuffer(obj, &self.view, flags)
8743  */
8744  __Pyx_TraceLine(348,0,__PYX_ERR(2, 348, __pyx_L1_error))
8745  __pyx_v_self->flags = __pyx_v_flags;
8746 
8747  /* "View.MemoryView":349
8748  * self.obj = obj
8749  * self.flags = flags
8750  * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
8751  * __Pyx_GetBuffer(obj, &self.view, flags)
8752  * if <PyObject *> self.view.obj == NULL:
8753  */
8754  __Pyx_TraceLine(349,0,__PYX_ERR(2, 349, __pyx_L1_error))
8755  __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
8756  __pyx_t_3 = (__pyx_t_2 != 0);
8757  if (!__pyx_t_3) {
8758  } else {
8759  __pyx_t_1 = __pyx_t_3;
8760  goto __pyx_L4_bool_binop_done;
8761  }
8762  __pyx_t_3 = (__pyx_v_obj != Py_None);
8763  __pyx_t_2 = (__pyx_t_3 != 0);
8764  __pyx_t_1 = __pyx_t_2;
8765  __pyx_L4_bool_binop_done:;
8766  if (__pyx_t_1) {
8767 
8768  /* "View.MemoryView":350
8769  * self.flags = flags
8770  * if type(self) is memoryview or obj is not None:
8771  * __Pyx_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<<
8772  * if <PyObject *> self.view.obj == NULL:
8773  * (<__pyx_buffer *> &self.view).obj = Py_None
8774  */
8775  __Pyx_TraceLine(350,0,__PYX_ERR(2, 350, __pyx_L1_error))
8776  __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 350, __pyx_L1_error)
8777 
8778  /* "View.MemoryView":351
8779  * if type(self) is memoryview or obj is not None:
8780  * __Pyx_GetBuffer(obj, &self.view, flags)
8781  * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
8782  * (<__pyx_buffer *> &self.view).obj = Py_None
8783  * Py_INCREF(Py_None)
8784  */
8785  __Pyx_TraceLine(351,0,__PYX_ERR(2, 351, __pyx_L1_error))
8786  __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
8787  if (__pyx_t_1) {
8788 
8789  /* "View.MemoryView":352
8790  * __Pyx_GetBuffer(obj, &self.view, flags)
8791  * if <PyObject *> self.view.obj == NULL:
8792  * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<<
8793  * Py_INCREF(Py_None)
8794  *
8795  */
8796  __Pyx_TraceLine(352,0,__PYX_ERR(2, 352, __pyx_L1_error))
8797  ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
8798 
8799  /* "View.MemoryView":353
8800  * if <PyObject *> self.view.obj == NULL:
8801  * (<__pyx_buffer *> &self.view).obj = Py_None
8802  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
8803  *
8804  * if not __PYX_CYTHON_ATOMICS_ENABLED():
8805  */
8806  __Pyx_TraceLine(353,0,__PYX_ERR(2, 353, __pyx_L1_error))
8807  Py_INCREF(Py_None);
8808 
8809  /* "View.MemoryView":351
8810  * if type(self) is memoryview or obj is not None:
8811  * __Pyx_GetBuffer(obj, &self.view, flags)
8812  * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
8813  * (<__pyx_buffer *> &self.view).obj = Py_None
8814  * Py_INCREF(Py_None)
8815  */
8816  }
8817 
8818  /* "View.MemoryView":349
8819  * self.obj = obj
8820  * self.flags = flags
8821  * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
8822  * __Pyx_GetBuffer(obj, &self.view, flags)
8823  * if <PyObject *> self.view.obj == NULL:
8824  */
8825  }
8826 
8827  /* "View.MemoryView":355
8828  * Py_INCREF(Py_None)
8829  *
8830  * if not __PYX_CYTHON_ATOMICS_ENABLED(): # <<<<<<<<<<<<<<
8831  * global __pyx_memoryview_thread_locks_used
8832  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
8833  */
8834  __Pyx_TraceLine(355,0,__PYX_ERR(2, 355, __pyx_L1_error))
8835  __pyx_t_1 = ((!(__PYX_CYTHON_ATOMICS_ENABLED() != 0)) != 0);
8836  if (__pyx_t_1) {
8837 
8838  /* "View.MemoryView":357
8839  * if not __PYX_CYTHON_ATOMICS_ENABLED():
8840  * global __pyx_memoryview_thread_locks_used
8841  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
8842  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
8843  * __pyx_memoryview_thread_locks_used += 1
8844  */
8845  __Pyx_TraceLine(357,0,__PYX_ERR(2, 357, __pyx_L1_error))
8846  __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
8847  if (__pyx_t_1) {
8848 
8849  /* "View.MemoryView":358
8850  * global __pyx_memoryview_thread_locks_used
8851  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
8852  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<<
8853  * __pyx_memoryview_thread_locks_used += 1
8854  * if self.lock is NULL:
8855  */
8856  __Pyx_TraceLine(358,0,__PYX_ERR(2, 358, __pyx_L1_error))
8857  __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
8858 
8859  /* "View.MemoryView":359
8860  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
8861  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
8862  * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<<
8863  * if self.lock is NULL:
8864  * self.lock = PyThread_allocate_lock()
8865  */
8866  __Pyx_TraceLine(359,0,__PYX_ERR(2, 359, __pyx_L1_error))
8867  __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
8868 
8869  /* "View.MemoryView":357
8870  * if not __PYX_CYTHON_ATOMICS_ENABLED():
8871  * global __pyx_memoryview_thread_locks_used
8872  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
8873  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
8874  * __pyx_memoryview_thread_locks_used += 1
8875  */
8876  }
8877 
8878  /* "View.MemoryView":360
8879  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
8880  * __pyx_memoryview_thread_locks_used += 1
8881  * if self.lock is NULL: # <<<<<<<<<<<<<<
8882  * self.lock = PyThread_allocate_lock()
8883  * if self.lock is NULL:
8884  */
8885  __Pyx_TraceLine(360,0,__PYX_ERR(2, 360, __pyx_L1_error))
8886  __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
8887  if (__pyx_t_1) {
8888 
8889  /* "View.MemoryView":361
8890  * __pyx_memoryview_thread_locks_used += 1
8891  * if self.lock is NULL:
8892  * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
8893  * if self.lock is NULL:
8894  * raise MemoryError
8895  */
8896  __Pyx_TraceLine(361,0,__PYX_ERR(2, 361, __pyx_L1_error))
8897  __pyx_v_self->lock = PyThread_allocate_lock();
8898 
8899  /* "View.MemoryView":362
8900  * if self.lock is NULL:
8901  * self.lock = PyThread_allocate_lock()
8902  * if self.lock is NULL: # <<<<<<<<<<<<<<
8903  * raise MemoryError
8904  *
8905  */
8906  __Pyx_TraceLine(362,0,__PYX_ERR(2, 362, __pyx_L1_error))
8907  __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
8908  if (unlikely(__pyx_t_1)) {
8909 
8910  /* "View.MemoryView":363
8911  * self.lock = PyThread_allocate_lock()
8912  * if self.lock is NULL:
8913  * raise MemoryError # <<<<<<<<<<<<<<
8914  *
8915  * if flags & PyBUF_FORMAT:
8916  */
8917  __Pyx_TraceLine(363,0,__PYX_ERR(2, 363, __pyx_L1_error))
8918  PyErr_NoMemory(); __PYX_ERR(2, 363, __pyx_L1_error)
8919 
8920  /* "View.MemoryView":362
8921  * if self.lock is NULL:
8922  * self.lock = PyThread_allocate_lock()
8923  * if self.lock is NULL: # <<<<<<<<<<<<<<
8924  * raise MemoryError
8925  *
8926  */
8927  }
8928 
8929  /* "View.MemoryView":360
8930  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
8931  * __pyx_memoryview_thread_locks_used += 1
8932  * if self.lock is NULL: # <<<<<<<<<<<<<<
8933  * self.lock = PyThread_allocate_lock()
8934  * if self.lock is NULL:
8935  */
8936  }
8937 
8938  /* "View.MemoryView":355
8939  * Py_INCREF(Py_None)
8940  *
8941  * if not __PYX_CYTHON_ATOMICS_ENABLED(): # <<<<<<<<<<<<<<
8942  * global __pyx_memoryview_thread_locks_used
8943  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
8944  */
8945  }
8946 
8947  /* "View.MemoryView":365
8948  * raise MemoryError
8949  *
8950  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
8951  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
8952  * else:
8953  */
8954  __Pyx_TraceLine(365,0,__PYX_ERR(2, 365, __pyx_L1_error))
8955  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
8956  if (__pyx_t_1) {
8957 
8958  /* "View.MemoryView":366
8959  *
8960  * if flags & PyBUF_FORMAT:
8961  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<<
8962  * else:
8963  * self.dtype_is_object = dtype_is_object
8964  */
8965  __Pyx_TraceLine(366,0,__PYX_ERR(2, 366, __pyx_L1_error))
8966  __pyx_t_2 = (((__pyx_v_self->view.format[0]) == 'O') != 0);
8967  if (__pyx_t_2) {
8968  } else {
8969  __pyx_t_1 = __pyx_t_2;
8970  goto __pyx_L12_bool_binop_done;
8971  }
8972  __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0);
8973  __pyx_t_1 = __pyx_t_2;
8974  __pyx_L12_bool_binop_done:;
8975  __pyx_v_self->dtype_is_object = __pyx_t_1;
8976 
8977  /* "View.MemoryView":365
8978  * raise MemoryError
8979  *
8980  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
8981  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
8982  * else:
8983  */
8984  goto __pyx_L11;
8985  }
8986 
8987  /* "View.MemoryView":368
8988  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
8989  * else:
8990  * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<<
8991  *
8992  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
8993  */
8994  __Pyx_TraceLine(368,0,__PYX_ERR(2, 368, __pyx_L1_error))
8995  /*else*/ {
8996  __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
8997  }
8998  __pyx_L11:;
8999 
9000  /* "View.MemoryView":370
9001  * self.dtype_is_object = dtype_is_object
9002  *
9003  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<<
9004  * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
9005  * self.typeinfo = NULL
9006  */
9007  __Pyx_TraceLine(370,0,__PYX_ERR(2, 370, __pyx_L1_error))
9008  __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int))));
9009 
9010  /* "View.MemoryView":372
9011  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
9012  * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
9013  * self.typeinfo = NULL # <<<<<<<<<<<<<<
9014  *
9015  * def __dealloc__(memoryview self):
9016  */
9017  __Pyx_TraceLine(372,0,__PYX_ERR(2, 372, __pyx_L1_error))
9018  __pyx_v_self->typeinfo = NULL;
9019 
9020  /* "View.MemoryView":346
9021  * cdef __Pyx_TypeInfo *typeinfo
9022  *
9023  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
9024  * self.obj = obj
9025  * self.flags = flags
9026  */
9027 
9028  /* function exit code */
9029  __pyx_r = 0;
9030  goto __pyx_L0;
9031  __pyx_L1_error:;
9032  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9033  __pyx_r = -1;
9034  __pyx_L0:;
9035  __Pyx_TraceReturn(Py_None, 0);
9036  __Pyx_RefNannyFinishContext();
9037  return __pyx_r;
9038 }
9039 
9040 /* "View.MemoryView":374
9041  * self.typeinfo = NULL
9042  *
9043  * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
9044  * if self.obj is not None:
9045  * __Pyx_ReleaseBuffer(&self.view)
9046  */
9047 
9048 /* Python wrapper */
9049 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
9050 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
9051  __Pyx_RefNannyDeclarations
9052  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
9053  __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));
9054 
9055  /* function exit code */
9056  __Pyx_RefNannyFinishContext();
9057 }
9058 
9059 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
9060  int __pyx_v_i;
9061  __Pyx_TraceDeclarations
9062  __Pyx_RefNannyDeclarations
9063  int __pyx_t_1;
9064  int __pyx_t_2;
9065  int __pyx_t_3;
9066  int __pyx_t_4;
9067  int __pyx_t_5;
9068  PyThread_type_lock __pyx_t_6;
9069  PyThread_type_lock __pyx_t_7;
9070  int __pyx_lineno = 0;
9071  const char *__pyx_filename = NULL;
9072  int __pyx_clineno = 0;
9073  __Pyx_RefNannySetupContext("__dealloc__", 0);
9074  __Pyx_TraceCall("__dealloc__", __pyx_f[2], 374, 0, __PYX_ERR(2, 374, __pyx_L1_error));
9075 
9076  /* "View.MemoryView":375
9077  *
9078  * def __dealloc__(memoryview self):
9079  * if self.obj is not None: # <<<<<<<<<<<<<<
9080  * __Pyx_ReleaseBuffer(&self.view)
9081  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
9082  */
9083  __Pyx_TraceLine(375,0,__PYX_ERR(2, 375, __pyx_L1_error))
9084  __pyx_t_1 = (__pyx_v_self->obj != Py_None);
9085  __pyx_t_2 = (__pyx_t_1 != 0);
9086  if (__pyx_t_2) {
9087 
9088  /* "View.MemoryView":376
9089  * def __dealloc__(memoryview self):
9090  * if self.obj is not None:
9091  * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<<
9092  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
9093  *
9094  */
9095  __Pyx_TraceLine(376,0,__PYX_ERR(2, 376, __pyx_L1_error))
9096  __Pyx_ReleaseBuffer((&__pyx_v_self->view));
9097 
9098  /* "View.MemoryView":375
9099  *
9100  * def __dealloc__(memoryview self):
9101  * if self.obj is not None: # <<<<<<<<<<<<<<
9102  * __Pyx_ReleaseBuffer(&self.view)
9103  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
9104  */
9105  goto __pyx_L3;
9106  }
9107 
9108  /* "View.MemoryView":377
9109  * if self.obj is not None:
9110  * __Pyx_ReleaseBuffer(&self.view)
9111  * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
9112  *
9113  * (<__pyx_buffer *> &self.view).obj = NULL
9114  */
9115  __Pyx_TraceLine(377,0,__PYX_ERR(2, 377, __pyx_L1_error))
9116  __pyx_t_2 = ((((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None) != 0);
9117  if (__pyx_t_2) {
9118 
9119  /* "View.MemoryView":379
9120  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
9121  *
9122  * (<__pyx_buffer *> &self.view).obj = NULL # <<<<<<<<<<<<<<
9123  * Py_DECREF(Py_None)
9124  *
9125  */
9126  __Pyx_TraceLine(379,0,__PYX_ERR(2, 379, __pyx_L1_error))
9127  ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
9128 
9129  /* "View.MemoryView":380
9130  *
9131  * (<__pyx_buffer *> &self.view).obj = NULL
9132  * Py_DECREF(Py_None) # <<<<<<<<<<<<<<
9133  *
9134  * cdef int i
9135  */
9136  __Pyx_TraceLine(380,0,__PYX_ERR(2, 380, __pyx_L1_error))
9137  Py_DECREF(Py_None);
9138 
9139  /* "View.MemoryView":377
9140  * if self.obj is not None:
9141  * __Pyx_ReleaseBuffer(&self.view)
9142  * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
9143  *
9144  * (<__pyx_buffer *> &self.view).obj = NULL
9145  */
9146  }
9147  __pyx_L3:;
9148 
9149  /* "View.MemoryView":384
9150  * cdef int i
9151  * global __pyx_memoryview_thread_locks_used
9152  * if self.lock != NULL: # <<<<<<<<<<<<<<
9153  * for i in range(__pyx_memoryview_thread_locks_used):
9154  * if __pyx_memoryview_thread_locks[i] is self.lock:
9155  */
9156  __Pyx_TraceLine(384,0,__PYX_ERR(2, 384, __pyx_L1_error))
9157  __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
9158  if (__pyx_t_2) {
9159 
9160  /* "View.MemoryView":385
9161  * global __pyx_memoryview_thread_locks_used
9162  * if self.lock != NULL:
9163  * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<<
9164  * if __pyx_memoryview_thread_locks[i] is self.lock:
9165  * __pyx_memoryview_thread_locks_used -= 1
9166  */
9167  __Pyx_TraceLine(385,0,__PYX_ERR(2, 385, __pyx_L1_error))
9168  __pyx_t_3 = __pyx_memoryview_thread_locks_used;
9169  __pyx_t_4 = __pyx_t_3;
9170  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
9171  __pyx_v_i = __pyx_t_5;
9172 
9173  /* "View.MemoryView":386
9174  * if self.lock != NULL:
9175  * for i in range(__pyx_memoryview_thread_locks_used):
9176  * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
9177  * __pyx_memoryview_thread_locks_used -= 1
9178  * if i != __pyx_memoryview_thread_locks_used:
9179  */
9180  __Pyx_TraceLine(386,0,__PYX_ERR(2, 386, __pyx_L1_error))
9181  __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
9182  if (__pyx_t_2) {
9183 
9184  /* "View.MemoryView":387
9185  * for i in range(__pyx_memoryview_thread_locks_used):
9186  * if __pyx_memoryview_thread_locks[i] is self.lock:
9187  * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<<
9188  * if i != __pyx_memoryview_thread_locks_used:
9189  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
9190  */
9191  __Pyx_TraceLine(387,0,__PYX_ERR(2, 387, __pyx_L1_error))
9192  __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
9193 
9194  /* "View.MemoryView":388
9195  * if __pyx_memoryview_thread_locks[i] is self.lock:
9196  * __pyx_memoryview_thread_locks_used -= 1
9197  * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
9198  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
9199  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
9200  */
9201  __Pyx_TraceLine(388,0,__PYX_ERR(2, 388, __pyx_L1_error))
9202  __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
9203  if (__pyx_t_2) {
9204 
9205  /* "View.MemoryView":390
9206  * if i != __pyx_memoryview_thread_locks_used:
9207  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
9208  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<<
9209  * break
9210  * else:
9211  */
9212  __Pyx_TraceLine(390,0,__PYX_ERR(2, 390, __pyx_L1_error))
9213  __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
9214  __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
9215 
9216  /* "View.MemoryView":389
9217  * __pyx_memoryview_thread_locks_used -= 1
9218  * if i != __pyx_memoryview_thread_locks_used:
9219  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<<
9220  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
9221  * break
9222  */
9223  __Pyx_TraceLine(389,0,__PYX_ERR(2, 389, __pyx_L1_error))
9224  (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
9225  (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
9226 
9227  /* "View.MemoryView":388
9228  * if __pyx_memoryview_thread_locks[i] is self.lock:
9229  * __pyx_memoryview_thread_locks_used -= 1
9230  * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
9231  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
9232  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
9233  */
9234  }
9235 
9236  /* "View.MemoryView":391
9237  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
9238  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
9239  * break # <<<<<<<<<<<<<<
9240  * else:
9241  * PyThread_free_lock(self.lock)
9242  */
9243  __Pyx_TraceLine(391,0,__PYX_ERR(2, 391, __pyx_L1_error))
9244  goto __pyx_L6_break;
9245 
9246  /* "View.MemoryView":386
9247  * if self.lock != NULL:
9248  * for i in range(__pyx_memoryview_thread_locks_used):
9249  * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
9250  * __pyx_memoryview_thread_locks_used -= 1
9251  * if i != __pyx_memoryview_thread_locks_used:
9252  */
9253  }
9254  }
9255  /*else*/ {
9256 
9257  /* "View.MemoryView":393
9258  * break
9259  * else:
9260  * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<<
9261  *
9262  * cdef char *get_item_pointer(memoryview self, object index) except NULL:
9263  */
9264  __Pyx_TraceLine(393,0,__PYX_ERR(2, 393, __pyx_L1_error))
9265  PyThread_free_lock(__pyx_v_self->lock);
9266  }
9267  __pyx_L6_break:;
9268 
9269  /* "View.MemoryView":384
9270  * cdef int i
9271  * global __pyx_memoryview_thread_locks_used
9272  * if self.lock != NULL: # <<<<<<<<<<<<<<
9273  * for i in range(__pyx_memoryview_thread_locks_used):
9274  * if __pyx_memoryview_thread_locks[i] is self.lock:
9275  */
9276  }
9277 
9278  /* "View.MemoryView":374
9279  * self.typeinfo = NULL
9280  *
9281  * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
9282  * if self.obj is not None:
9283  * __Pyx_ReleaseBuffer(&self.view)
9284  */
9285 
9286  /* function exit code */
9287  goto __pyx_L0;
9288  __pyx_L1_error:;
9289  __Pyx_WriteUnraisable("View.MemoryView.memoryview.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
9290  __pyx_L0:;
9291  __Pyx_TraceReturn(Py_None, 0);
9292  __Pyx_RefNannyFinishContext();
9293 }
9294 
9295 /* "View.MemoryView":395
9296  * PyThread_free_lock(self.lock)
9297  *
9298  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
9299  * cdef Py_ssize_t dim
9300  * cdef char *itemp = <char *> self.view.buf
9301  */
9302 
9303 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
9304  Py_ssize_t __pyx_v_dim;
9305  char *__pyx_v_itemp;
9306  PyObject *__pyx_v_idx = NULL;
9307  char *__pyx_r;
9308  __Pyx_TraceDeclarations
9309  __Pyx_RefNannyDeclarations
9310  Py_ssize_t __pyx_t_1;
9311  PyObject *__pyx_t_2 = NULL;
9312  Py_ssize_t __pyx_t_3;
9313  PyObject *(*__pyx_t_4)(PyObject *);
9314  PyObject *__pyx_t_5 = NULL;
9315  Py_ssize_t __pyx_t_6;
9316  char *__pyx_t_7;
9317  int __pyx_lineno = 0;
9318  const char *__pyx_filename = NULL;
9319  int __pyx_clineno = 0;
9320  __Pyx_RefNannySetupContext("get_item_pointer", 0);
9321  __Pyx_TraceCall("get_item_pointer", __pyx_f[2], 395, 0, __PYX_ERR(2, 395, __pyx_L1_error));
9322 
9323  /* "View.MemoryView":397
9324  * cdef char *get_item_pointer(memoryview self, object index) except NULL:
9325  * cdef Py_ssize_t dim
9326  * cdef char *itemp = <char *> self.view.buf # <<<<<<<<<<<<<<
9327  *
9328  * for dim, idx in enumerate(index):
9329  */
9330  __Pyx_TraceLine(397,0,__PYX_ERR(2, 397, __pyx_L1_error))
9331  __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
9332 
9333  /* "View.MemoryView":399
9334  * cdef char *itemp = <char *> self.view.buf
9335  *
9336  * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
9337  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
9338  *
9339  */
9340  __Pyx_TraceLine(399,0,__PYX_ERR(2, 399, __pyx_L1_error))
9341  __pyx_t_1 = 0;
9342  if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
9343  __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
9344  __pyx_t_4 = NULL;
9345  } else {
9346  __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 399, __pyx_L1_error)
9347  __Pyx_GOTREF(__pyx_t_2);
9348  __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 399, __pyx_L1_error)
9349  }
9350  for (;;) {
9351  if (likely(!__pyx_t_4)) {
9352  if (likely(PyList_CheckExact(__pyx_t_2))) {
9353  if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
9354  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9355  __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 399, __pyx_L1_error)
9356  #else
9357  __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 399, __pyx_L1_error)
9358  __Pyx_GOTREF(__pyx_t_5);
9359  #endif
9360  } else {
9361  if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
9362  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9363  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 399, __pyx_L1_error)
9364  #else
9365  __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 399, __pyx_L1_error)
9366  __Pyx_GOTREF(__pyx_t_5);
9367  #endif
9368  }
9369  } else {
9370  __pyx_t_5 = __pyx_t_4(__pyx_t_2);
9371  if (unlikely(!__pyx_t_5)) {
9372  PyObject* exc_type = PyErr_Occurred();
9373  if (exc_type) {
9374  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
9375  else __PYX_ERR(2, 399, __pyx_L1_error)
9376  }
9377  break;
9378  }
9379  __Pyx_GOTREF(__pyx_t_5);
9380  }
9381  __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
9382  __pyx_t_5 = 0;
9383  __pyx_v_dim = __pyx_t_1;
9384  __pyx_t_1 = (__pyx_t_1 + 1);
9385 
9386  /* "View.MemoryView":400
9387  *
9388  * for dim, idx in enumerate(index):
9389  * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<<
9390  *
9391  * return itemp
9392  */
9393  __Pyx_TraceLine(400,0,__PYX_ERR(2, 400, __pyx_L1_error))
9394  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 400, __pyx_L1_error)
9395  __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((char *)NULL))) __PYX_ERR(2, 400, __pyx_L1_error)
9396  __pyx_v_itemp = __pyx_t_7;
9397 
9398  /* "View.MemoryView":399
9399  * cdef char *itemp = <char *> self.view.buf
9400  *
9401  * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
9402  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
9403  *
9404  */
9405  __Pyx_TraceLine(399,0,__PYX_ERR(2, 399, __pyx_L1_error))
9406  }
9407  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9408 
9409  /* "View.MemoryView":402
9410  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
9411  *
9412  * return itemp # <<<<<<<<<<<<<<
9413  *
9414  *
9415  */
9416  __Pyx_TraceLine(402,0,__PYX_ERR(2, 402, __pyx_L1_error))
9417  __pyx_r = __pyx_v_itemp;
9418  goto __pyx_L0;
9419 
9420  /* "View.MemoryView":395
9421  * PyThread_free_lock(self.lock)
9422  *
9423  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
9424  * cdef Py_ssize_t dim
9425  * cdef char *itemp = <char *> self.view.buf
9426  */
9427 
9428  /* function exit code */
9429  __pyx_L1_error:;
9430  __Pyx_XDECREF(__pyx_t_2);
9431  __Pyx_XDECREF(__pyx_t_5);
9432  __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
9433  __pyx_r = NULL;
9434  __pyx_L0:;
9435  __Pyx_XDECREF(__pyx_v_idx);
9436  __Pyx_TraceReturn(Py_None, 0);
9437  __Pyx_RefNannyFinishContext();
9438  return __pyx_r;
9439 }
9440 
9441 /* "View.MemoryView":405
9442  *
9443  *
9444  * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
9445  * if index is Ellipsis:
9446  * return self
9447  */
9448 
9449 /* Python wrapper */
9450 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
9451 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
9452  PyObject *__pyx_r = 0;
9453  __Pyx_RefNannyDeclarations
9454  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
9455  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
9456 
9457  /* function exit code */
9458  __Pyx_RefNannyFinishContext();
9459  return __pyx_r;
9460 }
9461 
9462 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
9463  PyObject *__pyx_v_have_slices = NULL;
9464  PyObject *__pyx_v_indices = NULL;
9465  char *__pyx_v_itemp;
9466  PyObject *__pyx_r = NULL;
9467  __Pyx_TraceDeclarations
9468  __Pyx_RefNannyDeclarations
9469  int __pyx_t_1;
9470  int __pyx_t_2;
9471  PyObject *__pyx_t_3 = NULL;
9472  PyObject *__pyx_t_4 = NULL;
9473  PyObject *__pyx_t_5 = NULL;
9474  char *__pyx_t_6;
9475  int __pyx_lineno = 0;
9476  const char *__pyx_filename = NULL;
9477  int __pyx_clineno = 0;
9478  __Pyx_RefNannySetupContext("__getitem__", 0);
9479  __Pyx_TraceCall("__getitem__", __pyx_f[2], 405, 0, __PYX_ERR(2, 405, __pyx_L1_error));
9480 
9481  /* "View.MemoryView":406
9482  *
9483  * def __getitem__(memoryview self, object index):
9484  * if index is Ellipsis: # <<<<<<<<<<<<<<
9485  * return self
9486  *
9487  */
9488  __Pyx_TraceLine(406,0,__PYX_ERR(2, 406, __pyx_L1_error))
9489  __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
9490  __pyx_t_2 = (__pyx_t_1 != 0);
9491  if (__pyx_t_2) {
9492 
9493  /* "View.MemoryView":407
9494  * def __getitem__(memoryview self, object index):
9495  * if index is Ellipsis:
9496  * return self # <<<<<<<<<<<<<<
9497  *
9498  * have_slices, indices = _unellipsify(index, self.view.ndim)
9499  */
9500  __Pyx_TraceLine(407,0,__PYX_ERR(2, 407, __pyx_L1_error))
9501  __Pyx_XDECREF(__pyx_r);
9502  __Pyx_INCREF(((PyObject *)__pyx_v_self));
9503  __pyx_r = ((PyObject *)__pyx_v_self);
9504  goto __pyx_L0;
9505 
9506  /* "View.MemoryView":406
9507  *
9508  * def __getitem__(memoryview self, object index):
9509  * if index is Ellipsis: # <<<<<<<<<<<<<<
9510  * return self
9511  *
9512  */
9513  }
9514 
9515  /* "View.MemoryView":409
9516  * return self
9517  *
9518  * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
9519  *
9520  * cdef char *itemp
9521  */
9522  __Pyx_TraceLine(409,0,__PYX_ERR(2, 409, __pyx_L1_error))
9523  __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 409, __pyx_L1_error)
9524  __Pyx_GOTREF(__pyx_t_3);
9525  if (likely(__pyx_t_3 != Py_None)) {
9526  PyObject* sequence = __pyx_t_3;
9527  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
9528  if (unlikely(size != 2)) {
9529  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
9530  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
9531  __PYX_ERR(2, 409, __pyx_L1_error)
9532  }
9533  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9534  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
9535  __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
9536  __Pyx_INCREF(__pyx_t_4);
9537  __Pyx_INCREF(__pyx_t_5);
9538  #else
9539  __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 409, __pyx_L1_error)
9540  __Pyx_GOTREF(__pyx_t_4);
9541  __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 409, __pyx_L1_error)
9542  __Pyx_GOTREF(__pyx_t_5);
9543  #endif
9544  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9545  } else {
9546  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 409, __pyx_L1_error)
9547  }
9548  __pyx_v_have_slices = __pyx_t_4;
9549  __pyx_t_4 = 0;
9550  __pyx_v_indices = __pyx_t_5;
9551  __pyx_t_5 = 0;
9552 
9553  /* "View.MemoryView":412
9554  *
9555  * cdef char *itemp
9556  * if have_slices: # <<<<<<<<<<<<<<
9557  * return memview_slice(self, indices)
9558  * else:
9559  */
9560  __Pyx_TraceLine(412,0,__PYX_ERR(2, 412, __pyx_L1_error))
9561  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 412, __pyx_L1_error)
9562  if (__pyx_t_2) {
9563 
9564  /* "View.MemoryView":413
9565  * cdef char *itemp
9566  * if have_slices:
9567  * return memview_slice(self, indices) # <<<<<<<<<<<<<<
9568  * else:
9569  * itemp = self.get_item_pointer(indices)
9570  */
9571  __Pyx_TraceLine(413,0,__PYX_ERR(2, 413, __pyx_L1_error))
9572  __Pyx_XDECREF(__pyx_r);
9573  __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 413, __pyx_L1_error)
9574  __Pyx_GOTREF(__pyx_t_3);
9575  __pyx_r = __pyx_t_3;
9576  __pyx_t_3 = 0;
9577  goto __pyx_L0;
9578 
9579  /* "View.MemoryView":412
9580  *
9581  * cdef char *itemp
9582  * if have_slices: # <<<<<<<<<<<<<<
9583  * return memview_slice(self, indices)
9584  * else:
9585  */
9586  }
9587 
9588  /* "View.MemoryView":415
9589  * return memview_slice(self, indices)
9590  * else:
9591  * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<<
9592  * return self.convert_item_to_object(itemp)
9593  *
9594  */
9595  __Pyx_TraceLine(415,0,__PYX_ERR(2, 415, __pyx_L1_error))
9596  /*else*/ {
9597  __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == ((char *)NULL))) __PYX_ERR(2, 415, __pyx_L1_error)
9598  __pyx_v_itemp = __pyx_t_6;
9599 
9600  /* "View.MemoryView":416
9601  * else:
9602  * itemp = self.get_item_pointer(indices)
9603  * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<<
9604  *
9605  * def __setitem__(memoryview self, object index, object value):
9606  */
9607  __Pyx_TraceLine(416,0,__PYX_ERR(2, 416, __pyx_L1_error))
9608  __Pyx_XDECREF(__pyx_r);
9609  __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 416, __pyx_L1_error)
9610  __Pyx_GOTREF(__pyx_t_3);
9611  __pyx_r = __pyx_t_3;
9612  __pyx_t_3 = 0;
9613  goto __pyx_L0;
9614  }
9615 
9616  /* "View.MemoryView":405
9617  *
9618  *
9619  * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
9620  * if index is Ellipsis:
9621  * return self
9622  */
9623 
9624  /* function exit code */
9625  __pyx_L1_error:;
9626  __Pyx_XDECREF(__pyx_t_3);
9627  __Pyx_XDECREF(__pyx_t_4);
9628  __Pyx_XDECREF(__pyx_t_5);
9629  __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9630  __pyx_r = NULL;
9631  __pyx_L0:;
9632  __Pyx_XDECREF(__pyx_v_have_slices);
9633  __Pyx_XDECREF(__pyx_v_indices);
9634  __Pyx_XGIVEREF(__pyx_r);
9635  __Pyx_TraceReturn(__pyx_r, 0);
9636  __Pyx_RefNannyFinishContext();
9637  return __pyx_r;
9638 }
9639 
9640 /* "View.MemoryView":418
9641  * return self.convert_item_to_object(itemp)
9642  *
9643  * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
9644  * if self.view.readonly:
9645  * raise TypeError("Cannot assign to read-only memoryview")
9646  */
9647 
9648 /* Python wrapper */
9649 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
9650 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
9651  int __pyx_r;
9652  __Pyx_RefNannyDeclarations
9653  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
9654  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
9655 
9656  /* function exit code */
9657  __Pyx_RefNannyFinishContext();
9658  return __pyx_r;
9659 }
9660 
9661 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
9662  PyObject *__pyx_v_have_slices = NULL;
9663  PyObject *__pyx_v_obj = NULL;
9664  int __pyx_r;
9665  __Pyx_TraceDeclarations
9666  __Pyx_RefNannyDeclarations
9667  int __pyx_t_1;
9668  PyObject *__pyx_t_2 = NULL;
9669  PyObject *__pyx_t_3 = NULL;
9670  PyObject *__pyx_t_4 = NULL;
9671  int __pyx_lineno = 0;
9672  const char *__pyx_filename = NULL;
9673  int __pyx_clineno = 0;
9674  __Pyx_RefNannySetupContext("__setitem__", 0);
9675  __Pyx_TraceCall("__setitem__", __pyx_f[2], 418, 0, __PYX_ERR(2, 418, __pyx_L1_error));
9676  __Pyx_INCREF(__pyx_v_index);
9677 
9678  /* "View.MemoryView":419
9679  *
9680  * def __setitem__(memoryview self, object index, object value):
9681  * if self.view.readonly: # <<<<<<<<<<<<<<
9682  * raise TypeError("Cannot assign to read-only memoryview")
9683  *
9684  */
9685  __Pyx_TraceLine(419,0,__PYX_ERR(2, 419, __pyx_L1_error))
9686  __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
9687  if (unlikely(__pyx_t_1)) {
9688 
9689  /* "View.MemoryView":420
9690  * def __setitem__(memoryview self, object index, object value):
9691  * if self.view.readonly:
9692  * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
9693  *
9694  * have_slices, index = _unellipsify(index, self.view.ndim)
9695  */
9696  __Pyx_TraceLine(420,0,__PYX_ERR(2, 420, __pyx_L1_error))
9697  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 420, __pyx_L1_error)
9698  __Pyx_GOTREF(__pyx_t_2);
9699  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
9700  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9701  __PYX_ERR(2, 420, __pyx_L1_error)
9702 
9703  /* "View.MemoryView":419
9704  *
9705  * def __setitem__(memoryview self, object index, object value):
9706  * if self.view.readonly: # <<<<<<<<<<<<<<
9707  * raise TypeError("Cannot assign to read-only memoryview")
9708  *
9709  */
9710  }
9711 
9712  /* "View.MemoryView":422
9713  * raise TypeError("Cannot assign to read-only memoryview")
9714  *
9715  * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
9716  *
9717  * if have_slices:
9718  */
9719  __Pyx_TraceLine(422,0,__PYX_ERR(2, 422, __pyx_L1_error))
9720  __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 422, __pyx_L1_error)
9721  __Pyx_GOTREF(__pyx_t_2);
9722  if (likely(__pyx_t_2 != Py_None)) {
9723  PyObject* sequence = __pyx_t_2;
9724  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
9725  if (unlikely(size != 2)) {
9726  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
9727  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
9728  __PYX_ERR(2, 422, __pyx_L1_error)
9729  }
9730  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9731  __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
9732  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
9733  __Pyx_INCREF(__pyx_t_3);
9734  __Pyx_INCREF(__pyx_t_4);
9735  #else
9736  __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 422, __pyx_L1_error)
9737  __Pyx_GOTREF(__pyx_t_3);
9738  __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 422, __pyx_L1_error)
9739  __Pyx_GOTREF(__pyx_t_4);
9740  #endif
9741  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9742  } else {
9743  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 422, __pyx_L1_error)
9744  }
9745  __pyx_v_have_slices = __pyx_t_3;
9746  __pyx_t_3 = 0;
9747  __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
9748  __pyx_t_4 = 0;
9749 
9750  /* "View.MemoryView":424
9751  * have_slices, index = _unellipsify(index, self.view.ndim)
9752  *
9753  * if have_slices: # <<<<<<<<<<<<<<
9754  * obj = self.is_slice(value)
9755  * if obj:
9756  */
9757  __Pyx_TraceLine(424,0,__PYX_ERR(2, 424, __pyx_L1_error))
9758  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 424, __pyx_L1_error)
9759  if (__pyx_t_1) {
9760 
9761  /* "View.MemoryView":425
9762  *
9763  * if have_slices:
9764  * obj = self.is_slice(value) # <<<<<<<<<<<<<<
9765  * if obj:
9766  * self.setitem_slice_assignment(self[index], obj)
9767  */
9768  __Pyx_TraceLine(425,0,__PYX_ERR(2, 425, __pyx_L1_error))
9769  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 425, __pyx_L1_error)
9770  __Pyx_GOTREF(__pyx_t_2);
9771  __pyx_v_obj = __pyx_t_2;
9772  __pyx_t_2 = 0;
9773 
9774  /* "View.MemoryView":426
9775  * if have_slices:
9776  * obj = self.is_slice(value)
9777  * if obj: # <<<<<<<<<<<<<<
9778  * self.setitem_slice_assignment(self[index], obj)
9779  * else:
9780  */
9781  __Pyx_TraceLine(426,0,__PYX_ERR(2, 426, __pyx_L1_error))
9782  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 426, __pyx_L1_error)
9783  if (__pyx_t_1) {
9784 
9785  /* "View.MemoryView":427
9786  * obj = self.is_slice(value)
9787  * if obj:
9788  * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<<
9789  * else:
9790  * self.setitem_slice_assign_scalar(self[index], value)
9791  */
9792  __Pyx_TraceLine(427,0,__PYX_ERR(2, 427, __pyx_L1_error))
9793  __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 427, __pyx_L1_error)
9794  __Pyx_GOTREF(__pyx_t_2);
9795  __pyx_t_4 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 427, __pyx_L1_error)
9796  __Pyx_GOTREF(__pyx_t_4);
9797  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9798  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9799 
9800  /* "View.MemoryView":426
9801  * if have_slices:
9802  * obj = self.is_slice(value)
9803  * if obj: # <<<<<<<<<<<<<<
9804  * self.setitem_slice_assignment(self[index], obj)
9805  * else:
9806  */
9807  goto __pyx_L5;
9808  }
9809 
9810  /* "View.MemoryView":429
9811  * self.setitem_slice_assignment(self[index], obj)
9812  * else:
9813  * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<<
9814  * else:
9815  * self.setitem_indexed(index, value)
9816  */
9817  __Pyx_TraceLine(429,0,__PYX_ERR(2, 429, __pyx_L1_error))
9818  /*else*/ {
9819  __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 429, __pyx_L1_error)
9820  __Pyx_GOTREF(__pyx_t_4);
9821  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(2, 429, __pyx_L1_error)
9822  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 429, __pyx_L1_error)
9823  __Pyx_GOTREF(__pyx_t_2);
9824  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9825  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9826  }
9827  __pyx_L5:;
9828 
9829  /* "View.MemoryView":424
9830  * have_slices, index = _unellipsify(index, self.view.ndim)
9831  *
9832  * if have_slices: # <<<<<<<<<<<<<<
9833  * obj = self.is_slice(value)
9834  * if obj:
9835  */
9836  goto __pyx_L4;
9837  }
9838 
9839  /* "View.MemoryView":431
9840  * self.setitem_slice_assign_scalar(self[index], value)
9841  * else:
9842  * self.setitem_indexed(index, value) # <<<<<<<<<<<<<<
9843  *
9844  * cdef is_slice(self, obj):
9845  */
9846  __Pyx_TraceLine(431,0,__PYX_ERR(2, 431, __pyx_L1_error))
9847  /*else*/ {
9848  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 431, __pyx_L1_error)
9849  __Pyx_GOTREF(__pyx_t_2);
9850  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9851  }
9852  __pyx_L4:;
9853 
9854  /* "View.MemoryView":418
9855  * return self.convert_item_to_object(itemp)
9856  *
9857  * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
9858  * if self.view.readonly:
9859  * raise TypeError("Cannot assign to read-only memoryview")
9860  */
9861 
9862  /* function exit code */
9863  __pyx_r = 0;
9864  goto __pyx_L0;
9865  __pyx_L1_error:;
9866  __Pyx_XDECREF(__pyx_t_2);
9867  __Pyx_XDECREF(__pyx_t_3);
9868  __Pyx_XDECREF(__pyx_t_4);
9869  __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9870  __pyx_r = -1;
9871  __pyx_L0:;
9872  __Pyx_XDECREF(__pyx_v_have_slices);
9873  __Pyx_XDECREF(__pyx_v_obj);
9874  __Pyx_XDECREF(__pyx_v_index);
9875  __Pyx_TraceReturn(Py_None, 0);
9876  __Pyx_RefNannyFinishContext();
9877  return __pyx_r;
9878 }
9879 
9880 /* "View.MemoryView":433
9881  * self.setitem_indexed(index, value)
9882  *
9883  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
9884  * if not isinstance(obj, memoryview):
9885  * try:
9886  */
9887 
9888 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
9889  PyObject *__pyx_r = NULL;
9890  __Pyx_TraceDeclarations
9891  __Pyx_RefNannyDeclarations
9892  int __pyx_t_1;
9893  int __pyx_t_2;
9894  PyObject *__pyx_t_3 = NULL;
9895  PyObject *__pyx_t_4 = NULL;
9896  PyObject *__pyx_t_5 = NULL;
9897  PyObject *__pyx_t_6 = NULL;
9898  PyObject *__pyx_t_7 = NULL;
9899  PyObject *__pyx_t_8 = NULL;
9900  int __pyx_t_9;
9901  int __pyx_lineno = 0;
9902  const char *__pyx_filename = NULL;
9903  int __pyx_clineno = 0;
9904  __Pyx_RefNannySetupContext("is_slice", 0);
9905  __Pyx_TraceCall("is_slice", __pyx_f[2], 433, 0, __PYX_ERR(2, 433, __pyx_L1_error));
9906  __Pyx_INCREF(__pyx_v_obj);
9907 
9908  /* "View.MemoryView":434
9909  *
9910  * cdef is_slice(self, obj):
9911  * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
9912  * try:
9913  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
9914  */
9915  __Pyx_TraceLine(434,0,__PYX_ERR(2, 434, __pyx_L1_error))
9916  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
9917  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
9918  if (__pyx_t_2) {
9919 
9920  /* "View.MemoryView":435
9921  * cdef is_slice(self, obj):
9922  * if not isinstance(obj, memoryview):
9923  * try: # <<<<<<<<<<<<<<
9924  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
9925  * self.dtype_is_object)
9926  */
9927  __Pyx_TraceLine(435,0,__PYX_ERR(2, 435, __pyx_L1_error))
9928  {
9929  __Pyx_PyThreadState_declare
9930  __Pyx_PyThreadState_assign
9931  __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
9932  __Pyx_XGOTREF(__pyx_t_3);
9933  __Pyx_XGOTREF(__pyx_t_4);
9934  __Pyx_XGOTREF(__pyx_t_5);
9935  /*try:*/ {
9936 
9937  /* "View.MemoryView":436
9938  * if not isinstance(obj, memoryview):
9939  * try:
9940  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
9941  * self.dtype_is_object)
9942  * except TypeError:
9943  */
9944  __Pyx_TraceLine(436,0,__PYX_ERR(2, 436, __pyx_L4_error))
9945  __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 436, __pyx_L4_error)
9946  __Pyx_GOTREF(__pyx_t_6);
9947 
9948  /* "View.MemoryView":437
9949  * try:
9950  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
9951  * self.dtype_is_object) # <<<<<<<<<<<<<<
9952  * except TypeError:
9953  * return None
9954  */
9955  __Pyx_TraceLine(437,0,__PYX_ERR(2, 437, __pyx_L4_error))
9956  __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 437, __pyx_L4_error)
9957  __Pyx_GOTREF(__pyx_t_7);
9958 
9959  /* "View.MemoryView":436
9960  * if not isinstance(obj, memoryview):
9961  * try:
9962  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
9963  * self.dtype_is_object)
9964  * except TypeError:
9965  */
9966  __Pyx_TraceLine(436,0,__PYX_ERR(2, 436, __pyx_L4_error))
9967  __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 436, __pyx_L4_error)
9968  __Pyx_GOTREF(__pyx_t_8);
9969  __Pyx_INCREF(__pyx_v_obj);
9970  __Pyx_GIVEREF(__pyx_v_obj);
9971  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
9972  __Pyx_GIVEREF(__pyx_t_6);
9973  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
9974  __Pyx_GIVEREF(__pyx_t_7);
9975  PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
9976  __pyx_t_6 = 0;
9977  __pyx_t_7 = 0;
9978  __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 436, __pyx_L4_error)
9979  __Pyx_GOTREF(__pyx_t_7);
9980  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9981  __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
9982  __pyx_t_7 = 0;
9983 
9984  /* "View.MemoryView":435
9985  * cdef is_slice(self, obj):
9986  * if not isinstance(obj, memoryview):
9987  * try: # <<<<<<<<<<<<<<
9988  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
9989  * self.dtype_is_object)
9990  */
9991  }
9992  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
9993  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
9994  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9995  goto __pyx_L9_try_end;
9996  __pyx_L4_error:;
9997  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9998  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
9999  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
10000 
10001  /* "View.MemoryView":438
10002  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
10003  * self.dtype_is_object)
10004  * except TypeError: # <<<<<<<<<<<<<<
10005  * return None
10006  *
10007  */
10008  __Pyx_TraceLine(438,0,__PYX_ERR(2, 438, __pyx_L6_except_error))
10009  __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
10010  if (__pyx_t_9) {
10011  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
10012  if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(2, 438, __pyx_L6_except_error)
10013  __Pyx_GOTREF(__pyx_t_7);
10014  __Pyx_GOTREF(__pyx_t_8);
10015  __Pyx_GOTREF(__pyx_t_6);
10016 
10017  /* "View.MemoryView":439
10018  * self.dtype_is_object)
10019  * except TypeError:
10020  * return None # <<<<<<<<<<<<<<
10021  *
10022  * return obj
10023  */
10024  __Pyx_TraceLine(439,0,__PYX_ERR(2, 439, __pyx_L6_except_error))
10025  __Pyx_XDECREF(__pyx_r);
10026  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10027  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10028  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10029  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
10030  goto __pyx_L7_except_return;
10031  }
10032  goto __pyx_L6_except_error;
10033  __pyx_L6_except_error:;
10034 
10035  /* "View.MemoryView":435
10036  * cdef is_slice(self, obj):
10037  * if not isinstance(obj, memoryview):
10038  * try: # <<<<<<<<<<<<<<
10039  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
10040  * self.dtype_is_object)
10041  */
10042  __Pyx_XGIVEREF(__pyx_t_3);
10043  __Pyx_XGIVEREF(__pyx_t_4);
10044  __Pyx_XGIVEREF(__pyx_t_5);
10045  __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
10046  goto __pyx_L1_error;
10047  __pyx_L7_except_return:;
10048  __Pyx_XGIVEREF(__pyx_t_3);
10049  __Pyx_XGIVEREF(__pyx_t_4);
10050  __Pyx_XGIVEREF(__pyx_t_5);
10051  __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
10052  goto __pyx_L0;
10053  __pyx_L9_try_end:;
10054  }
10055 
10056  /* "View.MemoryView":434
10057  *
10058  * cdef is_slice(self, obj):
10059  * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
10060  * try:
10061  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
10062  */
10063  }
10064 
10065  /* "View.MemoryView":441
10066  * return None
10067  *
10068  * return obj # <<<<<<<<<<<<<<
10069  *
10070  * cdef setitem_slice_assignment(self, dst, src):
10071  */
10072  __Pyx_TraceLine(441,0,__PYX_ERR(2, 441, __pyx_L1_error))
10073  __Pyx_XDECREF(__pyx_r);
10074  __Pyx_INCREF(__pyx_v_obj);
10075  __pyx_r = __pyx_v_obj;
10076  goto __pyx_L0;
10077 
10078  /* "View.MemoryView":433
10079  * self.setitem_indexed(index, value)
10080  *
10081  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
10082  * if not isinstance(obj, memoryview):
10083  * try:
10084  */
10085 
10086  /* function exit code */
10087  __pyx_L1_error:;
10088  __Pyx_XDECREF(__pyx_t_6);
10089  __Pyx_XDECREF(__pyx_t_7);
10090  __Pyx_XDECREF(__pyx_t_8);
10091  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
10092  __pyx_r = 0;
10093  __pyx_L0:;
10094  __Pyx_XDECREF(__pyx_v_obj);
10095  __Pyx_XGIVEREF(__pyx_r);
10096  __Pyx_TraceReturn(__pyx_r, 0);
10097  __Pyx_RefNannyFinishContext();
10098  return __pyx_r;
10099 }
10100 
10101 /* "View.MemoryView":443
10102  * return obj
10103  *
10104  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
10105  * cdef __Pyx_memviewslice dst_slice
10106  * cdef __Pyx_memviewslice src_slice
10107  */
10108 
10109 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
10110  __Pyx_memviewslice __pyx_v_dst_slice;
10111  __Pyx_memviewslice __pyx_v_src_slice;
10112  PyObject *__pyx_r = NULL;
10113  __Pyx_TraceDeclarations
10114  __Pyx_RefNannyDeclarations
10115  __Pyx_memviewslice *__pyx_t_1;
10116  __Pyx_memviewslice *__pyx_t_2;
10117  PyObject *__pyx_t_3 = NULL;
10118  int __pyx_t_4;
10119  int __pyx_t_5;
10120  int __pyx_t_6;
10121  int __pyx_lineno = 0;
10122  const char *__pyx_filename = NULL;
10123  int __pyx_clineno = 0;
10124  __Pyx_RefNannySetupContext("setitem_slice_assignment", 0);
10125  __Pyx_TraceCall("setitem_slice_assignment", __pyx_f[2], 443, 0, __PYX_ERR(2, 443, __pyx_L1_error));
10126 
10127  /* "View.MemoryView":447
10128  * cdef __Pyx_memviewslice src_slice
10129  *
10130  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
10131  * get_slice_from_memview(dst, &dst_slice)[0],
10132  * src.ndim, dst.ndim, self.dtype_is_object)
10133  */
10134  __Pyx_TraceLine(447,0,__PYX_ERR(2, 447, __pyx_L1_error))
10135  if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(2, 447, __pyx_L1_error)
10136  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 447, __pyx_L1_error)
10137 
10138  /* "View.MemoryView":448
10139  *
10140  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
10141  * get_slice_from_memview(dst, &dst_slice)[0], # <<<<<<<<<<<<<<
10142  * src.ndim, dst.ndim, self.dtype_is_object)
10143  *
10144  */
10145  __Pyx_TraceLine(448,0,__PYX_ERR(2, 448, __pyx_L1_error))
10146  if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(2, 448, __pyx_L1_error)
10147  __pyx_t_2 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice)); if (unlikely(__pyx_t_2 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 448, __pyx_L1_error)
10148 
10149  /* "View.MemoryView":449
10150  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
10151  * get_slice_from_memview(dst, &dst_slice)[0],
10152  * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<<
10153  *
10154  * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
10155  */
10156  __Pyx_TraceLine(449,0,__PYX_ERR(2, 449, __pyx_L1_error))
10157  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 449, __pyx_L1_error)
10158  __Pyx_GOTREF(__pyx_t_3);
10159  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 449, __pyx_L1_error)
10160  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10161  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 449, __pyx_L1_error)
10162  __Pyx_GOTREF(__pyx_t_3);
10163  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 449, __pyx_L1_error)
10164  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10165 
10166  /* "View.MemoryView":447
10167  * cdef __Pyx_memviewslice src_slice
10168  *
10169  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
10170  * get_slice_from_memview(dst, &dst_slice)[0],
10171  * src.ndim, dst.ndim, self.dtype_is_object)
10172  */
10173  __Pyx_TraceLine(447,0,__PYX_ERR(2, 447, __pyx_L1_error))
10174  __pyx_t_6 = __pyx_memoryview_copy_contents((__pyx_t_1[0]), (__pyx_t_2[0]), __pyx_t_4, __pyx_t_5, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 447, __pyx_L1_error)
10175 
10176  /* "View.MemoryView":443
10177  * return obj
10178  *
10179  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
10180  * cdef __Pyx_memviewslice dst_slice
10181  * cdef __Pyx_memviewslice src_slice
10182  */
10183 
10184  /* function exit code */
10185  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10186  goto __pyx_L0;
10187  __pyx_L1_error:;
10188  __Pyx_XDECREF(__pyx_t_3);
10189  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
10190  __pyx_r = 0;
10191  __pyx_L0:;
10192  __Pyx_XGIVEREF(__pyx_r);
10193  __Pyx_TraceReturn(__pyx_r, 0);
10194  __Pyx_RefNannyFinishContext();
10195  return __pyx_r;
10196 }
10197 
10198 /* "View.MemoryView":451
10199  * src.ndim, dst.ndim, self.dtype_is_object)
10200  *
10201  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
10202  * cdef int array[128]
10203  * cdef void *tmp = NULL
10204  */
10205 
10206 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
10207  int __pyx_v_array[0x80];
10208  void *__pyx_v_tmp;
10209  void *__pyx_v_item;
10210  __Pyx_memviewslice *__pyx_v_dst_slice;
10211  __Pyx_memviewslice __pyx_v_tmp_slice;
10212  PyObject *__pyx_r = NULL;
10213  __Pyx_TraceDeclarations
10214  __Pyx_RefNannyDeclarations
10215  __Pyx_memviewslice *__pyx_t_1;
10216  int __pyx_t_2;
10217  PyObject *__pyx_t_3 = NULL;
10218  int __pyx_t_4;
10219  int __pyx_t_5;
10220  char const *__pyx_t_6;
10221  PyObject *__pyx_t_7 = NULL;
10222  PyObject *__pyx_t_8 = NULL;
10223  PyObject *__pyx_t_9 = NULL;
10224  PyObject *__pyx_t_10 = NULL;
10225  PyObject *__pyx_t_11 = NULL;
10226  PyObject *__pyx_t_12 = NULL;
10227  int __pyx_lineno = 0;
10228  const char *__pyx_filename = NULL;
10229  int __pyx_clineno = 0;
10230  __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0);
10231  __Pyx_TraceCall("setitem_slice_assign_scalar", __pyx_f[2], 451, 0, __PYX_ERR(2, 451, __pyx_L1_error));
10232 
10233  /* "View.MemoryView":453
10234  * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
10235  * cdef int array[128]
10236  * cdef void *tmp = NULL # <<<<<<<<<<<<<<
10237  * cdef void *item
10238  *
10239  */
10240  __Pyx_TraceLine(453,0,__PYX_ERR(2, 453, __pyx_L1_error))
10241  __pyx_v_tmp = NULL;
10242 
10243  /* "View.MemoryView":458
10244  * cdef __Pyx_memviewslice *dst_slice
10245  * cdef __Pyx_memviewslice tmp_slice
10246  * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<<
10247  *
10248  * if <size_t>self.view.itemsize > sizeof(array):
10249  */
10250  __Pyx_TraceLine(458,0,__PYX_ERR(2, 458, __pyx_L1_error))
10251  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 458, __pyx_L1_error)
10252  __pyx_v_dst_slice = __pyx_t_1;
10253 
10254  /* "View.MemoryView":460
10255  * dst_slice = get_slice_from_memview(dst, &tmp_slice)
10256  *
10257  * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
10258  * tmp = PyMem_Malloc(self.view.itemsize)
10259  * if tmp == NULL:
10260  */
10261  __Pyx_TraceLine(460,0,__PYX_ERR(2, 460, __pyx_L1_error))
10262  __pyx_t_2 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0);
10263  if (__pyx_t_2) {
10264 
10265  /* "View.MemoryView":461
10266  *
10267  * if <size_t>self.view.itemsize > sizeof(array):
10268  * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<<
10269  * if tmp == NULL:
10270  * raise MemoryError
10271  */
10272  __Pyx_TraceLine(461,0,__PYX_ERR(2, 461, __pyx_L1_error))
10273  __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
10274 
10275  /* "View.MemoryView":462
10276  * if <size_t>self.view.itemsize > sizeof(array):
10277  * tmp = PyMem_Malloc(self.view.itemsize)
10278  * if tmp == NULL: # <<<<<<<<<<<<<<
10279  * raise MemoryError
10280  * item = tmp
10281  */
10282  __Pyx_TraceLine(462,0,__PYX_ERR(2, 462, __pyx_L1_error))
10283  __pyx_t_2 = ((__pyx_v_tmp == NULL) != 0);
10284  if (unlikely(__pyx_t_2)) {
10285 
10286  /* "View.MemoryView":463
10287  * tmp = PyMem_Malloc(self.view.itemsize)
10288  * if tmp == NULL:
10289  * raise MemoryError # <<<<<<<<<<<<<<
10290  * item = tmp
10291  * else:
10292  */
10293  __Pyx_TraceLine(463,0,__PYX_ERR(2, 463, __pyx_L1_error))
10294  PyErr_NoMemory(); __PYX_ERR(2, 463, __pyx_L1_error)
10295 
10296  /* "View.MemoryView":462
10297  * if <size_t>self.view.itemsize > sizeof(array):
10298  * tmp = PyMem_Malloc(self.view.itemsize)
10299  * if tmp == NULL: # <<<<<<<<<<<<<<
10300  * raise MemoryError
10301  * item = tmp
10302  */
10303  }
10304 
10305  /* "View.MemoryView":464
10306  * if tmp == NULL:
10307  * raise MemoryError
10308  * item = tmp # <<<<<<<<<<<<<<
10309  * else:
10310  * item = <void *> array
10311  */
10312  __Pyx_TraceLine(464,0,__PYX_ERR(2, 464, __pyx_L1_error))
10313  __pyx_v_item = __pyx_v_tmp;
10314 
10315  /* "View.MemoryView":460
10316  * dst_slice = get_slice_from_memview(dst, &tmp_slice)
10317  *
10318  * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
10319  * tmp = PyMem_Malloc(self.view.itemsize)
10320  * if tmp == NULL:
10321  */
10322  goto __pyx_L3;
10323  }
10324 
10325  /* "View.MemoryView":466
10326  * item = tmp
10327  * else:
10328  * item = <void *> array # <<<<<<<<<<<<<<
10329  *
10330  * try:
10331  */
10332  __Pyx_TraceLine(466,0,__PYX_ERR(2, 466, __pyx_L1_error))
10333  /*else*/ {
10334  __pyx_v_item = ((void *)__pyx_v_array);
10335  }
10336  __pyx_L3:;
10337 
10338  /* "View.MemoryView":468
10339  * item = <void *> array
10340  *
10341  * try: # <<<<<<<<<<<<<<
10342  * if self.dtype_is_object:
10343  * (<PyObject **> item)[0] = <PyObject *> value
10344  */
10345  __Pyx_TraceLine(468,0,__PYX_ERR(2, 468, __pyx_L1_error))
10346  /*try:*/ {
10347 
10348  /* "View.MemoryView":469
10349  *
10350  * try:
10351  * if self.dtype_is_object: # <<<<<<<<<<<<<<
10352  * (<PyObject **> item)[0] = <PyObject *> value
10353  * else:
10354  */
10355  __Pyx_TraceLine(469,0,__PYX_ERR(2, 469, __pyx_L6_error))
10356  __pyx_t_2 = (__pyx_v_self->dtype_is_object != 0);
10357  if (__pyx_t_2) {
10358 
10359  /* "View.MemoryView":470
10360  * try:
10361  * if self.dtype_is_object:
10362  * (<PyObject **> item)[0] = <PyObject *> value # <<<<<<<<<<<<<<
10363  * else:
10364  * self.assign_item_from_object(<char *> item, value)
10365  */
10366  __Pyx_TraceLine(470,0,__PYX_ERR(2, 470, __pyx_L6_error))
10367  (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
10368 
10369  /* "View.MemoryView":469
10370  *
10371  * try:
10372  * if self.dtype_is_object: # <<<<<<<<<<<<<<
10373  * (<PyObject **> item)[0] = <PyObject *> value
10374  * else:
10375  */
10376  goto __pyx_L8;
10377  }
10378 
10379  /* "View.MemoryView":472
10380  * (<PyObject **> item)[0] = <PyObject *> value
10381  * else:
10382  * self.assign_item_from_object(<char *> item, value) # <<<<<<<<<<<<<<
10383  *
10384  *
10385  */
10386  __Pyx_TraceLine(472,0,__PYX_ERR(2, 472, __pyx_L6_error))
10387  /*else*/ {
10388  __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 472, __pyx_L6_error)
10389  __Pyx_GOTREF(__pyx_t_3);
10390  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10391  }
10392  __pyx_L8:;
10393 
10394  /* "View.MemoryView":476
10395  *
10396  *
10397  * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
10398  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
10399  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
10400  */
10401  __Pyx_TraceLine(476,0,__PYX_ERR(2, 476, __pyx_L6_error))
10402  __pyx_t_2 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
10403  if (__pyx_t_2) {
10404 
10405  /* "View.MemoryView":477
10406  *
10407  * if self.view.suboffsets != NULL:
10408  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<<
10409  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
10410  * item, self.dtype_is_object)
10411  */
10412  __Pyx_TraceLine(477,0,__PYX_ERR(2, 477, __pyx_L6_error))
10413  __pyx_t_3 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 477, __pyx_L6_error)
10414  __Pyx_GOTREF(__pyx_t_3);
10415  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10416 
10417  /* "View.MemoryView":476
10418  *
10419  *
10420  * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
10421  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
10422  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
10423  */
10424  }
10425 
10426  /* "View.MemoryView":478
10427  * if self.view.suboffsets != NULL:
10428  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
10429  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<<
10430  * item, self.dtype_is_object)
10431  * finally:
10432  */
10433  __Pyx_TraceLine(478,0,__PYX_ERR(2, 478, __pyx_L6_error))
10434  __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
10435  }
10436 
10437  /* "View.MemoryView":481
10438  * item, self.dtype_is_object)
10439  * finally:
10440  * PyMem_Free(tmp) # <<<<<<<<<<<<<<
10441  *
10442  * cdef setitem_indexed(self, index, value):
10443  */
10444  __Pyx_TraceLine(481,0,__PYX_ERR(2, 481, __pyx_L6_error))
10445  /*finally:*/ {
10446  /*normal exit:*/{
10447  PyMem_Free(__pyx_v_tmp);
10448  goto __pyx_L7;
10449  }
10450  __pyx_L6_error:;
10451  /*exception exit:*/{
10452  __Pyx_PyThreadState_declare
10453  __Pyx_PyThreadState_assign
10454  __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
10455  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
10456  if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
10457  if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
10458  __Pyx_XGOTREF(__pyx_t_7);
10459  __Pyx_XGOTREF(__pyx_t_8);
10460  __Pyx_XGOTREF(__pyx_t_9);
10461  __Pyx_XGOTREF(__pyx_t_10);
10462  __Pyx_XGOTREF(__pyx_t_11);
10463  __Pyx_XGOTREF(__pyx_t_12);
10464  __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
10465  {
10466  PyMem_Free(__pyx_v_tmp);
10467  }
10468  if (PY_MAJOR_VERSION >= 3) {
10469  __Pyx_XGIVEREF(__pyx_t_10);
10470  __Pyx_XGIVEREF(__pyx_t_11);
10471  __Pyx_XGIVEREF(__pyx_t_12);
10472  __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
10473  }
10474  __Pyx_XGIVEREF(__pyx_t_7);
10475  __Pyx_XGIVEREF(__pyx_t_8);
10476  __Pyx_XGIVEREF(__pyx_t_9);
10477  __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
10478  __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
10479  __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
10480  goto __pyx_L1_error;
10481  }
10482  __pyx_L7:;
10483  }
10484 
10485  /* "View.MemoryView":451
10486  * src.ndim, dst.ndim, self.dtype_is_object)
10487  *
10488  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
10489  * cdef int array[128]
10490  * cdef void *tmp = NULL
10491  */
10492 
10493  /* function exit code */
10494  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10495  goto __pyx_L0;
10496  __pyx_L1_error:;
10497  __Pyx_XDECREF(__pyx_t_3);
10498  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
10499  __pyx_r = 0;
10500  __pyx_L0:;
10501  __Pyx_XGIVEREF(__pyx_r);
10502  __Pyx_TraceReturn(__pyx_r, 0);
10503  __Pyx_RefNannyFinishContext();
10504  return __pyx_r;
10505 }
10506 
10507 /* "View.MemoryView":483
10508  * PyMem_Free(tmp)
10509  *
10510  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
10511  * cdef char *itemp = self.get_item_pointer(index)
10512  * self.assign_item_from_object(itemp, value)
10513  */
10514 
10515 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
10516  char *__pyx_v_itemp;
10517  PyObject *__pyx_r = NULL;
10518  __Pyx_TraceDeclarations
10519  __Pyx_RefNannyDeclarations
10520  char *__pyx_t_1;
10521  PyObject *__pyx_t_2 = NULL;
10522  int __pyx_lineno = 0;
10523  const char *__pyx_filename = NULL;
10524  int __pyx_clineno = 0;
10525  __Pyx_RefNannySetupContext("setitem_indexed", 0);
10526  __Pyx_TraceCall("setitem_indexed", __pyx_f[2], 483, 0, __PYX_ERR(2, 483, __pyx_L1_error));
10527 
10528  /* "View.MemoryView":484
10529  *
10530  * cdef setitem_indexed(self, index, value):
10531  * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<<
10532  * self.assign_item_from_object(itemp, value)
10533  *
10534  */
10535  __Pyx_TraceLine(484,0,__PYX_ERR(2, 484, __pyx_L1_error))
10536  __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(2, 484, __pyx_L1_error)
10537  __pyx_v_itemp = __pyx_t_1;
10538 
10539  /* "View.MemoryView":485
10540  * cdef setitem_indexed(self, index, value):
10541  * cdef char *itemp = self.get_item_pointer(index)
10542  * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<<
10543  *
10544  * cdef convert_item_to_object(self, char *itemp):
10545  */
10546  __Pyx_TraceLine(485,0,__PYX_ERR(2, 485, __pyx_L1_error))
10547  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 485, __pyx_L1_error)
10548  __Pyx_GOTREF(__pyx_t_2);
10549  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10550 
10551  /* "View.MemoryView":483
10552  * PyMem_Free(tmp)
10553  *
10554  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
10555  * cdef char *itemp = self.get_item_pointer(index)
10556  * self.assign_item_from_object(itemp, value)
10557  */
10558 
10559  /* function exit code */
10560  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10561  goto __pyx_L0;
10562  __pyx_L1_error:;
10563  __Pyx_XDECREF(__pyx_t_2);
10564  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
10565  __pyx_r = 0;
10566  __pyx_L0:;
10567  __Pyx_XGIVEREF(__pyx_r);
10568  __Pyx_TraceReturn(__pyx_r, 0);
10569  __Pyx_RefNannyFinishContext();
10570  return __pyx_r;
10571 }
10572 
10573 /* "View.MemoryView":487
10574  * self.assign_item_from_object(itemp, value)
10575  *
10576  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
10577  * """Only used if instantiated manually by the user, or if Cython doesn't
10578  * know how to convert the type"""
10579  */
10580 
10581 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
10582  PyObject *__pyx_v_struct = NULL;
10583  PyObject *__pyx_v_bytesitem = 0;
10584  PyObject *__pyx_v_result = NULL;
10585  PyObject *__pyx_r = NULL;
10586  __Pyx_TraceDeclarations
10587  __Pyx_RefNannyDeclarations
10588  PyObject *__pyx_t_1 = NULL;
10589  PyObject *__pyx_t_2 = NULL;
10590  PyObject *__pyx_t_3 = NULL;
10591  PyObject *__pyx_t_4 = NULL;
10592  PyObject *__pyx_t_5 = NULL;
10593  PyObject *__pyx_t_6 = NULL;
10594  PyObject *__pyx_t_7 = NULL;
10595  int __pyx_t_8;
10596  PyObject *__pyx_t_9 = NULL;
10597  size_t __pyx_t_10;
10598  int __pyx_t_11;
10599  int __pyx_lineno = 0;
10600  const char *__pyx_filename = NULL;
10601  int __pyx_clineno = 0;
10602  __Pyx_RefNannySetupContext("convert_item_to_object", 0);
10603  __Pyx_TraceCall("convert_item_to_object", __pyx_f[2], 487, 0, __PYX_ERR(2, 487, __pyx_L1_error));
10604 
10605  /* "View.MemoryView":490
10606  * """Only used if instantiated manually by the user, or if Cython doesn't
10607  * know how to convert the type"""
10608  * import struct # <<<<<<<<<<<<<<
10609  * cdef bytes bytesitem
10610  *
10611  */
10612  __Pyx_TraceLine(490,0,__PYX_ERR(2, 490, __pyx_L1_error))
10613  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 490, __pyx_L1_error)
10614  __Pyx_GOTREF(__pyx_t_1);
10615  __pyx_v_struct = __pyx_t_1;
10616  __pyx_t_1 = 0;
10617 
10618  /* "View.MemoryView":493
10619  * cdef bytes bytesitem
10620  *
10621  * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<<
10622  * try:
10623  * result = struct.unpack(self.view.format, bytesitem)
10624  */
10625  __Pyx_TraceLine(493,0,__PYX_ERR(2, 493, __pyx_L1_error))
10626  __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 493, __pyx_L1_error)
10627  __Pyx_GOTREF(__pyx_t_1);
10628  __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
10629  __pyx_t_1 = 0;
10630 
10631  /* "View.MemoryView":494
10632  *
10633  * bytesitem = itemp[:self.view.itemsize]
10634  * try: # <<<<<<<<<<<<<<
10635  * result = struct.unpack(self.view.format, bytesitem)
10636  * except struct.error:
10637  */
10638  __Pyx_TraceLine(494,0,__PYX_ERR(2, 494, __pyx_L1_error))
10639  {
10640  __Pyx_PyThreadState_declare
10641  __Pyx_PyThreadState_assign
10642  __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
10643  __Pyx_XGOTREF(__pyx_t_2);
10644  __Pyx_XGOTREF(__pyx_t_3);
10645  __Pyx_XGOTREF(__pyx_t_4);
10646  /*try:*/ {
10647 
10648  /* "View.MemoryView":495
10649  * bytesitem = itemp[:self.view.itemsize]
10650  * try:
10651  * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<<
10652  * except struct.error:
10653  * raise ValueError("Unable to convert item to object")
10654  */
10655  __Pyx_TraceLine(495,0,__PYX_ERR(2, 495, __pyx_L3_error))
10656  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 495, __pyx_L3_error)
10657  __Pyx_GOTREF(__pyx_t_5);
10658  __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 495, __pyx_L3_error)
10659  __Pyx_GOTREF(__pyx_t_6);
10660  __pyx_t_7 = NULL;
10661  __pyx_t_8 = 0;
10662  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
10663  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
10664  if (likely(__pyx_t_7)) {
10665  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
10666  __Pyx_INCREF(__pyx_t_7);
10667  __Pyx_INCREF(function);
10668  __Pyx_DECREF_SET(__pyx_t_5, function);
10669  __pyx_t_8 = 1;
10670  }
10671  }
10672  #if CYTHON_FAST_PYCALL
10673  if (PyFunction_Check(__pyx_t_5)) {
10674  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
10675  __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 495, __pyx_L3_error)
10676  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
10677  __Pyx_GOTREF(__pyx_t_1);
10678  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10679  } else
10680  #endif
10681  #if CYTHON_FAST_PYCCALL
10682  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
10683  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
10684  __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 495, __pyx_L3_error)
10685  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
10686  __Pyx_GOTREF(__pyx_t_1);
10687  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10688  } else
10689  #endif
10690  {
10691  __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 495, __pyx_L3_error)
10692  __Pyx_GOTREF(__pyx_t_9);
10693  if (__pyx_t_7) {
10694  __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
10695  }
10696  __Pyx_GIVEREF(__pyx_t_6);
10697  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
10698  __Pyx_INCREF(__pyx_v_bytesitem);
10699  __Pyx_GIVEREF(__pyx_v_bytesitem);
10700  PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
10701  __pyx_t_6 = 0;
10702  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 495, __pyx_L3_error)
10703  __Pyx_GOTREF(__pyx_t_1);
10704  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
10705  }
10706  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10707  __pyx_v_result = __pyx_t_1;
10708  __pyx_t_1 = 0;
10709 
10710  /* "View.MemoryView":494
10711  *
10712  * bytesitem = itemp[:self.view.itemsize]
10713  * try: # <<<<<<<<<<<<<<
10714  * result = struct.unpack(self.view.format, bytesitem)
10715  * except struct.error:
10716  */
10717  }
10718 
10719  /* "View.MemoryView":499
10720  * raise ValueError("Unable to convert item to object")
10721  * else:
10722  * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
10723  * return result[0]
10724  * return result
10725  */
10726  __Pyx_TraceLine(499,0,__PYX_ERR(2, 499, __pyx_L5_except_error))
10727  /*else:*/ {
10728  __pyx_t_10 = strlen(__pyx_v_self->view.format);
10729  __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
10730  if (__pyx_t_11) {
10731 
10732  /* "View.MemoryView":500
10733  * else:
10734  * if len(self.view.format) == 1:
10735  * return result[0] # <<<<<<<<<<<<<<
10736  * return result
10737  *
10738  */
10739  __Pyx_TraceLine(500,0,__PYX_ERR(2, 500, __pyx_L5_except_error))
10740  __Pyx_XDECREF(__pyx_r);
10741  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 500, __pyx_L5_except_error)
10742  __Pyx_GOTREF(__pyx_t_1);
10743  __pyx_r = __pyx_t_1;
10744  __pyx_t_1 = 0;
10745  goto __pyx_L6_except_return;
10746 
10747  /* "View.MemoryView":499
10748  * raise ValueError("Unable to convert item to object")
10749  * else:
10750  * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
10751  * return result[0]
10752  * return result
10753  */
10754  }
10755 
10756  /* "View.MemoryView":501
10757  * if len(self.view.format) == 1:
10758  * return result[0]
10759  * return result # <<<<<<<<<<<<<<
10760  *
10761  * cdef assign_item_from_object(self, char *itemp, object value):
10762  */
10763  __Pyx_TraceLine(501,0,__PYX_ERR(2, 501, __pyx_L5_except_error))
10764  __Pyx_XDECREF(__pyx_r);
10765  __Pyx_INCREF(__pyx_v_result);
10766  __pyx_r = __pyx_v_result;
10767  goto __pyx_L6_except_return;
10768  }
10769  __pyx_L3_error:;
10770  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
10771  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10772  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
10773  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
10774  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
10775 
10776  /* "View.MemoryView":496
10777  * try:
10778  * result = struct.unpack(self.view.format, bytesitem)
10779  * except struct.error: # <<<<<<<<<<<<<<
10780  * raise ValueError("Unable to convert item to object")
10781  * else:
10782  */
10783  __Pyx_TraceLine(496,0,__PYX_ERR(2, 496, __pyx_L5_except_error))
10784  __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
10785  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 496, __pyx_L5_except_error)
10786  __Pyx_GOTREF(__pyx_t_6);
10787  __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
10788  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10789  __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
10790  __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
10791  if (__pyx_t_8) {
10792  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
10793  if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(2, 496, __pyx_L5_except_error)
10794  __Pyx_GOTREF(__pyx_t_9);
10795  __Pyx_GOTREF(__pyx_t_5);
10796  __Pyx_GOTREF(__pyx_t_1);
10797 
10798  /* "View.MemoryView":497
10799  * result = struct.unpack(self.view.format, bytesitem)
10800  * except struct.error:
10801  * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
10802  * else:
10803  * if len(self.view.format) == 1:
10804  */
10805  __Pyx_TraceLine(497,0,__PYX_ERR(2, 497, __pyx_L5_except_error))
10806  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 497, __pyx_L5_except_error)
10807  __Pyx_GOTREF(__pyx_t_6);
10808  __Pyx_Raise(__pyx_t_6, 0, 0, 0);
10809  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10810  __PYX_ERR(2, 497, __pyx_L5_except_error)
10811  }
10812  goto __pyx_L5_except_error;
10813  __pyx_L5_except_error:;
10814 
10815  /* "View.MemoryView":494
10816  *
10817  * bytesitem = itemp[:self.view.itemsize]
10818  * try: # <<<<<<<<<<<<<<
10819  * result = struct.unpack(self.view.format, bytesitem)
10820  * except struct.error:
10821  */
10822  __Pyx_XGIVEREF(__pyx_t_2);
10823  __Pyx_XGIVEREF(__pyx_t_3);
10824  __Pyx_XGIVEREF(__pyx_t_4);
10825  __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
10826  goto __pyx_L1_error;
10827  __pyx_L6_except_return:;
10828  __Pyx_XGIVEREF(__pyx_t_2);
10829  __Pyx_XGIVEREF(__pyx_t_3);
10830  __Pyx_XGIVEREF(__pyx_t_4);
10831  __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
10832  goto __pyx_L0;
10833  }
10834 
10835  /* "View.MemoryView":487
10836  * self.assign_item_from_object(itemp, value)
10837  *
10838  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
10839  * """Only used if instantiated manually by the user, or if Cython doesn't
10840  * know how to convert the type"""
10841  */
10842 
10843  /* function exit code */
10844  __pyx_L1_error:;
10845  __Pyx_XDECREF(__pyx_t_1);
10846  __Pyx_XDECREF(__pyx_t_5);
10847  __Pyx_XDECREF(__pyx_t_6);
10848  __Pyx_XDECREF(__pyx_t_7);
10849  __Pyx_XDECREF(__pyx_t_9);
10850  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
10851  __pyx_r = 0;
10852  __pyx_L0:;
10853  __Pyx_XDECREF(__pyx_v_struct);
10854  __Pyx_XDECREF(__pyx_v_bytesitem);
10855  __Pyx_XDECREF(__pyx_v_result);
10856  __Pyx_XGIVEREF(__pyx_r);
10857  __Pyx_TraceReturn(__pyx_r, 0);
10858  __Pyx_RefNannyFinishContext();
10859  return __pyx_r;
10860 }
10861 
10862 /* "View.MemoryView":503
10863  * return result
10864  *
10865  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
10866  * """Only used if instantiated manually by the user, or if Cython doesn't
10867  * know how to convert the type"""
10868  */
10869 
10870 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
10871  PyObject *__pyx_v_struct = NULL;
10872  char __pyx_v_c;
10873  PyObject *__pyx_v_bytesvalue = 0;
10874  Py_ssize_t __pyx_v_i;
10875  PyObject *__pyx_r = NULL;
10876  __Pyx_TraceDeclarations
10877  __Pyx_RefNannyDeclarations
10878  PyObject *__pyx_t_1 = NULL;
10879  int __pyx_t_2;
10880  int __pyx_t_3;
10881  PyObject *__pyx_t_4 = NULL;
10882  PyObject *__pyx_t_5 = NULL;
10883  PyObject *__pyx_t_6 = NULL;
10884  int __pyx_t_7;
10885  PyObject *__pyx_t_8 = NULL;
10886  Py_ssize_t __pyx_t_9;
10887  PyObject *__pyx_t_10 = NULL;
10888  char *__pyx_t_11;
10889  char *__pyx_t_12;
10890  char *__pyx_t_13;
10891  char *__pyx_t_14;
10892  int __pyx_lineno = 0;
10893  const char *__pyx_filename = NULL;
10894  int __pyx_clineno = 0;
10895  __Pyx_RefNannySetupContext("assign_item_from_object", 0);
10896  __Pyx_TraceCall("assign_item_from_object", __pyx_f[2], 503, 0, __PYX_ERR(2, 503, __pyx_L1_error));
10897 
10898  /* "View.MemoryView":506
10899  * """Only used if instantiated manually by the user, or if Cython doesn't
10900  * know how to convert the type"""
10901  * import struct # <<<<<<<<<<<<<<
10902  * cdef char c
10903  * cdef bytes bytesvalue
10904  */
10905  __Pyx_TraceLine(506,0,__PYX_ERR(2, 506, __pyx_L1_error))
10906  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 506, __pyx_L1_error)
10907  __Pyx_GOTREF(__pyx_t_1);
10908  __pyx_v_struct = __pyx_t_1;
10909  __pyx_t_1 = 0;
10910 
10911  /* "View.MemoryView":511
10912  * cdef Py_ssize_t i
10913  *
10914  * if isinstance(value, tuple): # <<<<<<<<<<<<<<
10915  * bytesvalue = struct.pack(self.view.format, *value)
10916  * else:
10917  */
10918  __Pyx_TraceLine(511,0,__PYX_ERR(2, 511, __pyx_L1_error))
10919  __pyx_t_2 = PyTuple_Check(__pyx_v_value);
10920  __pyx_t_3 = (__pyx_t_2 != 0);
10921  if (__pyx_t_3) {
10922 
10923  /* "View.MemoryView":512
10924  *
10925  * if isinstance(value, tuple):
10926  * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<<
10927  * else:
10928  * bytesvalue = struct.pack(self.view.format, value)
10929  */
10930  __Pyx_TraceLine(512,0,__PYX_ERR(2, 512, __pyx_L1_error))
10931  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 512, __pyx_L1_error)
10932  __Pyx_GOTREF(__pyx_t_1);
10933  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 512, __pyx_L1_error)
10934  __Pyx_GOTREF(__pyx_t_4);
10935  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 512, __pyx_L1_error)
10936  __Pyx_GOTREF(__pyx_t_5);
10937  __Pyx_GIVEREF(__pyx_t_4);
10938  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
10939  __pyx_t_4 = 0;
10940  __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 512, __pyx_L1_error)
10941  __Pyx_GOTREF(__pyx_t_4);
10942  __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 512, __pyx_L1_error)
10943  __Pyx_GOTREF(__pyx_t_6);
10944  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10945  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10946  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 512, __pyx_L1_error)
10947  __Pyx_GOTREF(__pyx_t_4);
10948  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10949  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10950  if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||((void)PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(2, 512, __pyx_L1_error)
10951  __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
10952  __pyx_t_4 = 0;
10953 
10954  /* "View.MemoryView":511
10955  * cdef Py_ssize_t i
10956  *
10957  * if isinstance(value, tuple): # <<<<<<<<<<<<<<
10958  * bytesvalue = struct.pack(self.view.format, *value)
10959  * else:
10960  */
10961  goto __pyx_L3;
10962  }
10963 
10964  /* "View.MemoryView":514
10965  * bytesvalue = struct.pack(self.view.format, *value)
10966  * else:
10967  * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<<
10968  *
10969  * for i, c in enumerate(bytesvalue):
10970  */
10971  __Pyx_TraceLine(514,0,__PYX_ERR(2, 514, __pyx_L1_error))
10972  /*else*/ {
10973  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 514, __pyx_L1_error)
10974  __Pyx_GOTREF(__pyx_t_6);
10975  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 514, __pyx_L1_error)
10976  __Pyx_GOTREF(__pyx_t_1);
10977  __pyx_t_5 = NULL;
10978  __pyx_t_7 = 0;
10979  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
10980  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
10981  if (likely(__pyx_t_5)) {
10982  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
10983  __Pyx_INCREF(__pyx_t_5);
10984  __Pyx_INCREF(function);
10985  __Pyx_DECREF_SET(__pyx_t_6, function);
10986  __pyx_t_7 = 1;
10987  }
10988  }
10989  #if CYTHON_FAST_PYCALL
10990  if (PyFunction_Check(__pyx_t_6)) {
10991  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
10992  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 514, __pyx_L1_error)
10993  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10994  __Pyx_GOTREF(__pyx_t_4);
10995  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10996  } else
10997  #endif
10998  #if CYTHON_FAST_PYCCALL
10999  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
11000  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
11001  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 514, __pyx_L1_error)
11002  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11003  __Pyx_GOTREF(__pyx_t_4);
11004  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11005  } else
11006  #endif
11007  {
11008  __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 514, __pyx_L1_error)
11009  __Pyx_GOTREF(__pyx_t_8);
11010  if (__pyx_t_5) {
11011  __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
11012  }
11013  __Pyx_GIVEREF(__pyx_t_1);
11014  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
11015  __Pyx_INCREF(__pyx_v_value);
11016  __Pyx_GIVEREF(__pyx_v_value);
11017  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
11018  __pyx_t_1 = 0;
11019  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 514, __pyx_L1_error)
11020  __Pyx_GOTREF(__pyx_t_4);
11021  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11022  }
11023  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11024  if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||((void)PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(2, 514, __pyx_L1_error)
11025  __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
11026  __pyx_t_4 = 0;
11027  }
11028  __pyx_L3:;
11029 
11030  /* "View.MemoryView":516
11031  * bytesvalue = struct.pack(self.view.format, value)
11032  *
11033  * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
11034  * itemp[i] = c
11035  *
11036  */
11037  __Pyx_TraceLine(516,0,__PYX_ERR(2, 516, __pyx_L1_error))
11038  __pyx_t_9 = 0;
11039  if (unlikely(__pyx_v_bytesvalue == Py_None)) {
11040  PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
11041  __PYX_ERR(2, 516, __pyx_L1_error)
11042  }
11043  __Pyx_INCREF(__pyx_v_bytesvalue);
11044  __pyx_t_10 = __pyx_v_bytesvalue;
11045  __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
11046  __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
11047  for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
11048  __pyx_t_11 = __pyx_t_14;
11049  __pyx_v_c = (__pyx_t_11[0]);
11050 
11051  /* "View.MemoryView":517
11052  *
11053  * for i, c in enumerate(bytesvalue):
11054  * itemp[i] = c # <<<<<<<<<<<<<<
11055  *
11056  * @cname('getbuffer')
11057  */
11058  __Pyx_TraceLine(517,0,__PYX_ERR(2, 517, __pyx_L1_error))
11059  __pyx_v_i = __pyx_t_9;
11060 
11061  /* "View.MemoryView":516
11062  * bytesvalue = struct.pack(self.view.format, value)
11063  *
11064  * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
11065  * itemp[i] = c
11066  *
11067  */
11068  __Pyx_TraceLine(516,0,__PYX_ERR(2, 516, __pyx_L1_error))
11069  __pyx_t_9 = (__pyx_t_9 + 1);
11070 
11071  /* "View.MemoryView":517
11072  *
11073  * for i, c in enumerate(bytesvalue):
11074  * itemp[i] = c # <<<<<<<<<<<<<<
11075  *
11076  * @cname('getbuffer')
11077  */
11078  __Pyx_TraceLine(517,0,__PYX_ERR(2, 517, __pyx_L1_error))
11079  (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
11080  }
11081  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
11082 
11083  /* "View.MemoryView":503
11084  * return result
11085  *
11086  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
11087  * """Only used if instantiated manually by the user, or if Cython doesn't
11088  * know how to convert the type"""
11089  */
11090 
11091  /* function exit code */
11092  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11093  goto __pyx_L0;
11094  __pyx_L1_error:;
11095  __Pyx_XDECREF(__pyx_t_1);
11096  __Pyx_XDECREF(__pyx_t_4);
11097  __Pyx_XDECREF(__pyx_t_5);
11098  __Pyx_XDECREF(__pyx_t_6);
11099  __Pyx_XDECREF(__pyx_t_8);
11100  __Pyx_XDECREF(__pyx_t_10);
11101  __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
11102  __pyx_r = 0;
11103  __pyx_L0:;
11104  __Pyx_XDECREF(__pyx_v_struct);
11105  __Pyx_XDECREF(__pyx_v_bytesvalue);
11106  __Pyx_XGIVEREF(__pyx_r);
11107  __Pyx_TraceReturn(__pyx_r, 0);
11108  __Pyx_RefNannyFinishContext();
11109  return __pyx_r;
11110 }
11111 
11112 /* "View.MemoryView":520
11113  *
11114  * @cname('getbuffer')
11115  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
11116  * if flags & PyBUF_WRITABLE and self.view.readonly:
11117  * raise ValueError("Cannot create writable memory view from read-only memoryview")
11118  */
11119 
11120 /* Python wrapper */
11121 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
11122 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
11123  int __pyx_r;
11124  __Pyx_RefNannyDeclarations
11125  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
11126  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
11127 
11128  /* function exit code */
11129  __Pyx_RefNannyFinishContext();
11130  return __pyx_r;
11131 }
11132 
11133 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
11134  int __pyx_r;
11135  __Pyx_TraceDeclarations
11136  __Pyx_RefNannyDeclarations
11137  int __pyx_t_1;
11138  int __pyx_t_2;
11139  PyObject *__pyx_t_3 = NULL;
11140  Py_ssize_t *__pyx_t_4;
11141  char *__pyx_t_5;
11142  void *__pyx_t_6;
11143  int __pyx_t_7;
11144  Py_ssize_t __pyx_t_8;
11145  int __pyx_lineno = 0;
11146  const char *__pyx_filename = NULL;
11147  int __pyx_clineno = 0;
11148  if (__pyx_v_info == NULL) {
11149  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
11150  return -1;
11151  }
11152  __Pyx_RefNannySetupContext("__getbuffer__", 0);
11153  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
11154  __Pyx_GIVEREF(__pyx_v_info->obj);
11155  __Pyx_TraceCall("__getbuffer__", __pyx_f[2], 520, 0, __PYX_ERR(2, 520, __pyx_L1_error));
11156 
11157  /* "View.MemoryView":521
11158  * @cname('getbuffer')
11159  * def __getbuffer__(self, Py_buffer *info, int flags):
11160  * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
11161  * raise ValueError("Cannot create writable memory view from read-only memoryview")
11162  *
11163  */
11164  __Pyx_TraceLine(521,0,__PYX_ERR(2, 521, __pyx_L1_error))
11165  __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
11166  if (__pyx_t_2) {
11167  } else {
11168  __pyx_t_1 = __pyx_t_2;
11169  goto __pyx_L4_bool_binop_done;
11170  }
11171  __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
11172  __pyx_t_1 = __pyx_t_2;
11173  __pyx_L4_bool_binop_done:;
11174  if (unlikely(__pyx_t_1)) {
11175 
11176  /* "View.MemoryView":522
11177  * def __getbuffer__(self, Py_buffer *info, int flags):
11178  * if flags & PyBUF_WRITABLE and self.view.readonly:
11179  * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
11180  *
11181  * if flags & PyBUF_ND:
11182  */
11183  __Pyx_TraceLine(522,0,__PYX_ERR(2, 522, __pyx_L1_error))
11184  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 522, __pyx_L1_error)
11185  __Pyx_GOTREF(__pyx_t_3);
11186  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
11187  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11188  __PYX_ERR(2, 522, __pyx_L1_error)
11189 
11190  /* "View.MemoryView":521
11191  * @cname('getbuffer')
11192  * def __getbuffer__(self, Py_buffer *info, int flags):
11193  * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
11194  * raise ValueError("Cannot create writable memory view from read-only memoryview")
11195  *
11196  */
11197  }
11198 
11199  /* "View.MemoryView":524
11200  * raise ValueError("Cannot create writable memory view from read-only memoryview")
11201  *
11202  * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
11203  * info.shape = self.view.shape
11204  * else:
11205  */
11206  __Pyx_TraceLine(524,0,__PYX_ERR(2, 524, __pyx_L1_error))
11207  __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
11208  if (__pyx_t_1) {
11209 
11210  /* "View.MemoryView":525
11211  *
11212  * if flags & PyBUF_ND:
11213  * info.shape = self.view.shape # <<<<<<<<<<<<<<
11214  * else:
11215  * info.shape = NULL
11216  */
11217  __Pyx_TraceLine(525,0,__PYX_ERR(2, 525, __pyx_L1_error))
11218  __pyx_t_4 = __pyx_v_self->view.shape;
11219  __pyx_v_info->shape = __pyx_t_4;
11220 
11221  /* "View.MemoryView":524
11222  * raise ValueError("Cannot create writable memory view from read-only memoryview")
11223  *
11224  * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
11225  * info.shape = self.view.shape
11226  * else:
11227  */
11228  goto __pyx_L6;
11229  }
11230 
11231  /* "View.MemoryView":527
11232  * info.shape = self.view.shape
11233  * else:
11234  * info.shape = NULL # <<<<<<<<<<<<<<
11235  *
11236  * if flags & PyBUF_STRIDES:
11237  */
11238  __Pyx_TraceLine(527,0,__PYX_ERR(2, 527, __pyx_L1_error))
11239  /*else*/ {
11240  __pyx_v_info->shape = NULL;
11241  }
11242  __pyx_L6:;
11243 
11244  /* "View.MemoryView":529
11245  * info.shape = NULL
11246  *
11247  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
11248  * info.strides = self.view.strides
11249  * else:
11250  */
11251  __Pyx_TraceLine(529,0,__PYX_ERR(2, 529, __pyx_L1_error))
11252  __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
11253  if (__pyx_t_1) {
11254 
11255  /* "View.MemoryView":530
11256  *
11257  * if flags & PyBUF_STRIDES:
11258  * info.strides = self.view.strides # <<<<<<<<<<<<<<
11259  * else:
11260  * info.strides = NULL
11261  */
11262  __Pyx_TraceLine(530,0,__PYX_ERR(2, 530, __pyx_L1_error))
11263  __pyx_t_4 = __pyx_v_self->view.strides;
11264  __pyx_v_info->strides = __pyx_t_4;
11265 
11266  /* "View.MemoryView":529
11267  * info.shape = NULL
11268  *
11269  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
11270  * info.strides = self.view.strides
11271  * else:
11272  */
11273  goto __pyx_L7;
11274  }
11275 
11276  /* "View.MemoryView":532
11277  * info.strides = self.view.strides
11278  * else:
11279  * info.strides = NULL # <<<<<<<<<<<<<<
11280  *
11281  * if flags & PyBUF_INDIRECT:
11282  */
11283  __Pyx_TraceLine(532,0,__PYX_ERR(2, 532, __pyx_L1_error))
11284  /*else*/ {
11285  __pyx_v_info->strides = NULL;
11286  }
11287  __pyx_L7:;
11288 
11289  /* "View.MemoryView":534
11290  * info.strides = NULL
11291  *
11292  * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
11293  * info.suboffsets = self.view.suboffsets
11294  * else:
11295  */
11296  __Pyx_TraceLine(534,0,__PYX_ERR(2, 534, __pyx_L1_error))
11297  __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
11298  if (__pyx_t_1) {
11299 
11300  /* "View.MemoryView":535
11301  *
11302  * if flags & PyBUF_INDIRECT:
11303  * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<<
11304  * else:
11305  * info.suboffsets = NULL
11306  */
11307  __Pyx_TraceLine(535,0,__PYX_ERR(2, 535, __pyx_L1_error))
11308  __pyx_t_4 = __pyx_v_self->view.suboffsets;
11309  __pyx_v_info->suboffsets = __pyx_t_4;
11310 
11311  /* "View.MemoryView":534
11312  * info.strides = NULL
11313  *
11314  * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
11315  * info.suboffsets = self.view.suboffsets
11316  * else:
11317  */
11318  goto __pyx_L8;
11319  }
11320 
11321  /* "View.MemoryView":537
11322  * info.suboffsets = self.view.suboffsets
11323  * else:
11324  * info.suboffsets = NULL # <<<<<<<<<<<<<<
11325  *
11326  * if flags & PyBUF_FORMAT:
11327  */
11328  __Pyx_TraceLine(537,0,__PYX_ERR(2, 537, __pyx_L1_error))
11329  /*else*/ {
11330  __pyx_v_info->suboffsets = NULL;
11331  }
11332  __pyx_L8:;
11333 
11334  /* "View.MemoryView":539
11335  * info.suboffsets = NULL
11336  *
11337  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
11338  * info.format = self.view.format
11339  * else:
11340  */
11341  __Pyx_TraceLine(539,0,__PYX_ERR(2, 539, __pyx_L1_error))
11342  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
11343  if (__pyx_t_1) {
11344 
11345  /* "View.MemoryView":540
11346  *
11347  * if flags & PyBUF_FORMAT:
11348  * info.format = self.view.format # <<<<<<<<<<<<<<
11349  * else:
11350  * info.format = NULL
11351  */
11352  __Pyx_TraceLine(540,0,__PYX_ERR(2, 540, __pyx_L1_error))
11353  __pyx_t_5 = __pyx_v_self->view.format;
11354  __pyx_v_info->format = __pyx_t_5;
11355 
11356  /* "View.MemoryView":539
11357  * info.suboffsets = NULL
11358  *
11359  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
11360  * info.format = self.view.format
11361  * else:
11362  */
11363  goto __pyx_L9;
11364  }
11365 
11366  /* "View.MemoryView":542
11367  * info.format = self.view.format
11368  * else:
11369  * info.format = NULL # <<<<<<<<<<<<<<
11370  *
11371  * info.buf = self.view.buf
11372  */
11373  __Pyx_TraceLine(542,0,__PYX_ERR(2, 542, __pyx_L1_error))
11374  /*else*/ {
11375  __pyx_v_info->format = NULL;
11376  }
11377  __pyx_L9:;
11378 
11379  /* "View.MemoryView":544
11380  * info.format = NULL
11381  *
11382  * info.buf = self.view.buf # <<<<<<<<<<<<<<
11383  * info.ndim = self.view.ndim
11384  * info.itemsize = self.view.itemsize
11385  */
11386  __Pyx_TraceLine(544,0,__PYX_ERR(2, 544, __pyx_L1_error))
11387  __pyx_t_6 = __pyx_v_self->view.buf;
11388  __pyx_v_info->buf = __pyx_t_6;
11389 
11390  /* "View.MemoryView":545
11391  *
11392  * info.buf = self.view.buf
11393  * info.ndim = self.view.ndim # <<<<<<<<<<<<<<
11394  * info.itemsize = self.view.itemsize
11395  * info.len = self.view.len
11396  */
11397  __Pyx_TraceLine(545,0,__PYX_ERR(2, 545, __pyx_L1_error))
11398  __pyx_t_7 = __pyx_v_self->view.ndim;
11399  __pyx_v_info->ndim = __pyx_t_7;
11400 
11401  /* "View.MemoryView":546
11402  * info.buf = self.view.buf
11403  * info.ndim = self.view.ndim
11404  * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<<
11405  * info.len = self.view.len
11406  * info.readonly = self.view.readonly
11407  */
11408  __Pyx_TraceLine(546,0,__PYX_ERR(2, 546, __pyx_L1_error))
11409  __pyx_t_8 = __pyx_v_self->view.itemsize;
11410  __pyx_v_info->itemsize = __pyx_t_8;
11411 
11412  /* "View.MemoryView":547
11413  * info.ndim = self.view.ndim
11414  * info.itemsize = self.view.itemsize
11415  * info.len = self.view.len # <<<<<<<<<<<<<<
11416  * info.readonly = self.view.readonly
11417  * info.obj = self
11418  */
11419  __Pyx_TraceLine(547,0,__PYX_ERR(2, 547, __pyx_L1_error))
11420  __pyx_t_8 = __pyx_v_self->view.len;
11421  __pyx_v_info->len = __pyx_t_8;
11422 
11423  /* "View.MemoryView":548
11424  * info.itemsize = self.view.itemsize
11425  * info.len = self.view.len
11426  * info.readonly = self.view.readonly # <<<<<<<<<<<<<<
11427  * info.obj = self
11428  *
11429  */
11430  __Pyx_TraceLine(548,0,__PYX_ERR(2, 548, __pyx_L1_error))
11431  __pyx_t_1 = __pyx_v_self->view.readonly;
11432  __pyx_v_info->readonly = __pyx_t_1;
11433 
11434  /* "View.MemoryView":549
11435  * info.len = self.view.len
11436  * info.readonly = self.view.readonly
11437  * info.obj = self # <<<<<<<<<<<<<<
11438  *
11439  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
11440  */
11441  __Pyx_TraceLine(549,0,__PYX_ERR(2, 549, __pyx_L1_error))
11442  __Pyx_INCREF(((PyObject *)__pyx_v_self));
11443  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
11444  __Pyx_GOTREF(__pyx_v_info->obj);
11445  __Pyx_DECREF(__pyx_v_info->obj);
11446  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
11447 
11448  /* "View.MemoryView":520
11449  *
11450  * @cname('getbuffer')
11451  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
11452  * if flags & PyBUF_WRITABLE and self.view.readonly:
11453  * raise ValueError("Cannot create writable memory view from read-only memoryview")
11454  */
11455 
11456  /* function exit code */
11457  __pyx_r = 0;
11458  goto __pyx_L0;
11459  __pyx_L1_error:;
11460  __Pyx_XDECREF(__pyx_t_3);
11461  __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11462  __pyx_r = -1;
11463  if (__pyx_v_info->obj != NULL) {
11464  __Pyx_GOTREF(__pyx_v_info->obj);
11465  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
11466  }
11467  goto __pyx_L2;
11468  __pyx_L0:;
11469  if (__pyx_v_info->obj == Py_None) {
11470  __Pyx_GOTREF(__pyx_v_info->obj);
11471  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
11472  }
11473  __pyx_L2:;
11474  __Pyx_TraceReturn(Py_None, 0);
11475  __Pyx_RefNannyFinishContext();
11476  return __pyx_r;
11477 }
11478 
11479 /* "View.MemoryView":555
11480  *
11481  * @property
11482  * def T(self): # <<<<<<<<<<<<<<
11483  * cdef _memoryviewslice result = memoryview_copy(self)
11484  * transpose_memslice(&result.from_slice)
11485  */
11486 
11487 /* Python wrapper */
11488 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
11489 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
11490  PyObject *__pyx_r = 0;
11491  __Pyx_RefNannyDeclarations
11492  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11493  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11494 
11495  /* function exit code */
11496  __Pyx_RefNannyFinishContext();
11497  return __pyx_r;
11498 }
11499 
11500 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11501  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
11502  PyObject *__pyx_r = NULL;
11503  __Pyx_TraceDeclarations
11504  __Pyx_RefNannyDeclarations
11505  PyObject *__pyx_t_1 = NULL;
11506  int __pyx_t_2;
11507  int __pyx_lineno = 0;
11508  const char *__pyx_filename = NULL;
11509  int __pyx_clineno = 0;
11510  __Pyx_RefNannySetupContext("__get__", 0);
11511  __Pyx_TraceCall("__get__", __pyx_f[2], 555, 0, __PYX_ERR(2, 555, __pyx_L1_error));
11512 
11513  /* "View.MemoryView":556
11514  * @property
11515  * def T(self):
11516  * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<<
11517  * transpose_memslice(&result.from_slice)
11518  * return result
11519  */
11520  __Pyx_TraceLine(556,0,__PYX_ERR(2, 556, __pyx_L1_error))
11521  __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 556, __pyx_L1_error)
11522  __Pyx_GOTREF(__pyx_t_1);
11523  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(2, 556, __pyx_L1_error)
11524  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
11525  __pyx_t_1 = 0;
11526 
11527  /* "View.MemoryView":557
11528  * def T(self):
11529  * cdef _memoryviewslice result = memoryview_copy(self)
11530  * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<<
11531  * return result
11532  *
11533  */
11534  __Pyx_TraceLine(557,0,__PYX_ERR(2, 557, __pyx_L1_error))
11535  __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(2, 557, __pyx_L1_error)
11536 
11537  /* "View.MemoryView":558
11538  * cdef _memoryviewslice result = memoryview_copy(self)
11539  * transpose_memslice(&result.from_slice)
11540  * return result # <<<<<<<<<<<<<<
11541  *
11542  * @property
11543  */
11544  __Pyx_TraceLine(558,0,__PYX_ERR(2, 558, __pyx_L1_error))
11545  __Pyx_XDECREF(__pyx_r);
11546  __Pyx_INCREF(((PyObject *)__pyx_v_result));
11547  __pyx_r = ((PyObject *)__pyx_v_result);
11548  goto __pyx_L0;
11549 
11550  /* "View.MemoryView":555
11551  *
11552  * @property
11553  * def T(self): # <<<<<<<<<<<<<<
11554  * cdef _memoryviewslice result = memoryview_copy(self)
11555  * transpose_memslice(&result.from_slice)
11556  */
11557 
11558  /* function exit code */
11559  __pyx_L1_error:;
11560  __Pyx_XDECREF(__pyx_t_1);
11561  __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11562  __pyx_r = NULL;
11563  __pyx_L0:;
11564  __Pyx_XDECREF((PyObject *)__pyx_v_result);
11565  __Pyx_XGIVEREF(__pyx_r);
11566  __Pyx_TraceReturn(__pyx_r, 0);
11567  __Pyx_RefNannyFinishContext();
11568  return __pyx_r;
11569 }
11570 
11571 /* "View.MemoryView":561
11572  *
11573  * @property
11574  * def base(self): # <<<<<<<<<<<<<<
11575  * return self.obj
11576  *
11577  */
11578 
11579 /* Python wrapper */
11580 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
11581 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
11582  PyObject *__pyx_r = 0;
11583  __Pyx_RefNannyDeclarations
11584  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11585  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11586 
11587  /* function exit code */
11588  __Pyx_RefNannyFinishContext();
11589  return __pyx_r;
11590 }
11591 
11592 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11593  PyObject *__pyx_r = NULL;
11594  __Pyx_TraceDeclarations
11595  __Pyx_RefNannyDeclarations
11596  int __pyx_lineno = 0;
11597  const char *__pyx_filename = NULL;
11598  int __pyx_clineno = 0;
11599  __Pyx_RefNannySetupContext("__get__", 0);
11600  __Pyx_TraceCall("__get__", __pyx_f[2], 561, 0, __PYX_ERR(2, 561, __pyx_L1_error));
11601 
11602  /* "View.MemoryView":562
11603  * @property
11604  * def base(self):
11605  * return self.obj # <<<<<<<<<<<<<<
11606  *
11607  * @property
11608  */
11609  __Pyx_TraceLine(562,0,__PYX_ERR(2, 562, __pyx_L1_error))
11610  __Pyx_XDECREF(__pyx_r);
11611  __Pyx_INCREF(__pyx_v_self->obj);
11612  __pyx_r = __pyx_v_self->obj;
11613  goto __pyx_L0;
11614 
11615  /* "View.MemoryView":561
11616  *
11617  * @property
11618  * def base(self): # <<<<<<<<<<<<<<
11619  * return self.obj
11620  *
11621  */
11622 
11623  /* function exit code */
11624  __pyx_L1_error:;
11625  __Pyx_AddTraceback("View.MemoryView.memoryview.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11626  __pyx_r = NULL;
11627  __pyx_L0:;
11628  __Pyx_XGIVEREF(__pyx_r);
11629  __Pyx_TraceReturn(__pyx_r, 0);
11630  __Pyx_RefNannyFinishContext();
11631  return __pyx_r;
11632 }
11633 
11634 /* "View.MemoryView":565
11635  *
11636  * @property
11637  * def shape(self): # <<<<<<<<<<<<<<
11638  * return tuple([length for length in self.view.shape[:self.view.ndim]])
11639  *
11640  */
11641 
11642 /* Python wrapper */
11643 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
11644 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
11645  PyObject *__pyx_r = 0;
11646  __Pyx_RefNannyDeclarations
11647  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11648  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11649 
11650  /* function exit code */
11651  __Pyx_RefNannyFinishContext();
11652  return __pyx_r;
11653 }
11654 
11655 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11656  Py_ssize_t __pyx_v_length;
11657  PyObject *__pyx_r = NULL;
11658  __Pyx_TraceDeclarations
11659  __Pyx_RefNannyDeclarations
11660  PyObject *__pyx_t_1 = NULL;
11661  Py_ssize_t *__pyx_t_2;
11662  Py_ssize_t *__pyx_t_3;
11663  Py_ssize_t *__pyx_t_4;
11664  PyObject *__pyx_t_5 = NULL;
11665  int __pyx_lineno = 0;
11666  const char *__pyx_filename = NULL;
11667  int __pyx_clineno = 0;
11668  __Pyx_RefNannySetupContext("__get__", 0);
11669  __Pyx_TraceCall("__get__", __pyx_f[2], 565, 0, __PYX_ERR(2, 565, __pyx_L1_error));
11670 
11671  /* "View.MemoryView":566
11672  * @property
11673  * def shape(self):
11674  * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<<
11675  *
11676  * @property
11677  */
11678  __Pyx_TraceLine(566,0,__PYX_ERR(2, 566, __pyx_L1_error))
11679  __Pyx_XDECREF(__pyx_r);
11680  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 566, __pyx_L1_error)
11681  __Pyx_GOTREF(__pyx_t_1);
11682  __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
11683  for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
11684  __pyx_t_2 = __pyx_t_4;
11685  __pyx_v_length = (__pyx_t_2[0]);
11686  __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 566, __pyx_L1_error)
11687  __Pyx_GOTREF(__pyx_t_5);
11688  if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(2, 566, __pyx_L1_error)
11689  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11690  }
11691  __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 566, __pyx_L1_error)
11692  __Pyx_GOTREF(__pyx_t_5);
11693  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11694  __pyx_r = __pyx_t_5;
11695  __pyx_t_5 = 0;
11696  goto __pyx_L0;
11697 
11698  /* "View.MemoryView":565
11699  *
11700  * @property
11701  * def shape(self): # <<<<<<<<<<<<<<
11702  * return tuple([length for length in self.view.shape[:self.view.ndim]])
11703  *
11704  */
11705 
11706  /* function exit code */
11707  __pyx_L1_error:;
11708  __Pyx_XDECREF(__pyx_t_1);
11709  __Pyx_XDECREF(__pyx_t_5);
11710  __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11711  __pyx_r = NULL;
11712  __pyx_L0:;
11713  __Pyx_XGIVEREF(__pyx_r);
11714  __Pyx_TraceReturn(__pyx_r, 0);
11715  __Pyx_RefNannyFinishContext();
11716  return __pyx_r;
11717 }
11718 
11719 /* "View.MemoryView":569
11720  *
11721  * @property
11722  * def strides(self): # <<<<<<<<<<<<<<
11723  * if self.view.strides == NULL:
11724  *
11725  */
11726 
11727 /* Python wrapper */
11728 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
11729 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
11730  PyObject *__pyx_r = 0;
11731  __Pyx_RefNannyDeclarations
11732  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11733  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11734 
11735  /* function exit code */
11736  __Pyx_RefNannyFinishContext();
11737  return __pyx_r;
11738 }
11739 
11740 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11741  Py_ssize_t __pyx_v_stride;
11742  PyObject *__pyx_r = NULL;
11743  __Pyx_TraceDeclarations
11744  __Pyx_RefNannyDeclarations
11745  int __pyx_t_1;
11746  PyObject *__pyx_t_2 = NULL;
11747  Py_ssize_t *__pyx_t_3;
11748  Py_ssize_t *__pyx_t_4;
11749  Py_ssize_t *__pyx_t_5;
11750  PyObject *__pyx_t_6 = NULL;
11751  int __pyx_lineno = 0;
11752  const char *__pyx_filename = NULL;
11753  int __pyx_clineno = 0;
11754  __Pyx_RefNannySetupContext("__get__", 0);
11755  __Pyx_TraceCall("__get__", __pyx_f[2], 569, 0, __PYX_ERR(2, 569, __pyx_L1_error));
11756 
11757  /* "View.MemoryView":570
11758  * @property
11759  * def strides(self):
11760  * if self.view.strides == NULL: # <<<<<<<<<<<<<<
11761  *
11762  * raise ValueError("Buffer view does not expose strides")
11763  */
11764  __Pyx_TraceLine(570,0,__PYX_ERR(2, 570, __pyx_L1_error))
11765  __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
11766  if (unlikely(__pyx_t_1)) {
11767 
11768  /* "View.MemoryView":572
11769  * if self.view.strides == NULL:
11770  *
11771  * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
11772  *
11773  * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
11774  */
11775  __Pyx_TraceLine(572,0,__PYX_ERR(2, 572, __pyx_L1_error))
11776  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 572, __pyx_L1_error)
11777  __Pyx_GOTREF(__pyx_t_2);
11778  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
11779  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11780  __PYX_ERR(2, 572, __pyx_L1_error)
11781 
11782  /* "View.MemoryView":570
11783  * @property
11784  * def strides(self):
11785  * if self.view.strides == NULL: # <<<<<<<<<<<<<<
11786  *
11787  * raise ValueError("Buffer view does not expose strides")
11788  */
11789  }
11790 
11791  /* "View.MemoryView":574
11792  * raise ValueError("Buffer view does not expose strides")
11793  *
11794  * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<<
11795  *
11796  * @property
11797  */
11798  __Pyx_TraceLine(574,0,__PYX_ERR(2, 574, __pyx_L1_error))
11799  __Pyx_XDECREF(__pyx_r);
11800  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 574, __pyx_L1_error)
11801  __Pyx_GOTREF(__pyx_t_2);
11802  __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
11803  for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
11804  __pyx_t_3 = __pyx_t_5;
11805  __pyx_v_stride = (__pyx_t_3[0]);
11806  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 574, __pyx_L1_error)
11807  __Pyx_GOTREF(__pyx_t_6);
11808  if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(2, 574, __pyx_L1_error)
11809  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11810  }
11811  __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 574, __pyx_L1_error)
11812  __Pyx_GOTREF(__pyx_t_6);
11813  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11814  __pyx_r = __pyx_t_6;
11815  __pyx_t_6 = 0;
11816  goto __pyx_L0;
11817 
11818  /* "View.MemoryView":569
11819  *
11820  * @property
11821  * def strides(self): # <<<<<<<<<<<<<<
11822  * if self.view.strides == NULL:
11823  *
11824  */
11825 
11826  /* function exit code */
11827  __pyx_L1_error:;
11828  __Pyx_XDECREF(__pyx_t_2);
11829  __Pyx_XDECREF(__pyx_t_6);
11830  __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11831  __pyx_r = NULL;
11832  __pyx_L0:;
11833  __Pyx_XGIVEREF(__pyx_r);
11834  __Pyx_TraceReturn(__pyx_r, 0);
11835  __Pyx_RefNannyFinishContext();
11836  return __pyx_r;
11837 }
11838 
11839 /* "View.MemoryView":577
11840  *
11841  * @property
11842  * def suboffsets(self): # <<<<<<<<<<<<<<
11843  * if self.view.suboffsets == NULL:
11844  * return (-1,) * self.view.ndim
11845  */
11846 
11847 /* Python wrapper */
11848 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
11849 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
11850  PyObject *__pyx_r = 0;
11851  __Pyx_RefNannyDeclarations
11852  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11853  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11854 
11855  /* function exit code */
11856  __Pyx_RefNannyFinishContext();
11857  return __pyx_r;
11858 }
11859 
11860 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11861  Py_ssize_t __pyx_v_suboffset;
11862  PyObject *__pyx_r = NULL;
11863  __Pyx_TraceDeclarations
11864  __Pyx_RefNannyDeclarations
11865  int __pyx_t_1;
11866  PyObject *__pyx_t_2 = NULL;
11867  PyObject *__pyx_t_3 = NULL;
11868  Py_ssize_t *__pyx_t_4;
11869  Py_ssize_t *__pyx_t_5;
11870  Py_ssize_t *__pyx_t_6;
11871  int __pyx_lineno = 0;
11872  const char *__pyx_filename = NULL;
11873  int __pyx_clineno = 0;
11874  __Pyx_RefNannySetupContext("__get__", 0);
11875  __Pyx_TraceCall("__get__", __pyx_f[2], 577, 0, __PYX_ERR(2, 577, __pyx_L1_error));
11876 
11877  /* "View.MemoryView":578
11878  * @property
11879  * def suboffsets(self):
11880  * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
11881  * return (-1,) * self.view.ndim
11882  *
11883  */
11884  __Pyx_TraceLine(578,0,__PYX_ERR(2, 578, __pyx_L1_error))
11885  __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
11886  if (__pyx_t_1) {
11887 
11888  /* "View.MemoryView":579
11889  * def suboffsets(self):
11890  * if self.view.suboffsets == NULL:
11891  * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
11892  *
11893  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
11894  */
11895  __Pyx_TraceLine(579,0,__PYX_ERR(2, 579, __pyx_L1_error))
11896  __Pyx_XDECREF(__pyx_r);
11897  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 579, __pyx_L1_error)
11898  __Pyx_GOTREF(__pyx_t_2);
11899  __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__14, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 579, __pyx_L1_error)
11900  __Pyx_GOTREF(__pyx_t_3);
11901  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11902  __pyx_r = __pyx_t_3;
11903  __pyx_t_3 = 0;
11904  goto __pyx_L0;
11905 
11906  /* "View.MemoryView":578
11907  * @property
11908  * def suboffsets(self):
11909  * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
11910  * return (-1,) * self.view.ndim
11911  *
11912  */
11913  }
11914 
11915  /* "View.MemoryView":581
11916  * return (-1,) * self.view.ndim
11917  *
11918  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<<
11919  *
11920  * @property
11921  */
11922  __Pyx_TraceLine(581,0,__PYX_ERR(2, 581, __pyx_L1_error))
11923  __Pyx_XDECREF(__pyx_r);
11924  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 581, __pyx_L1_error)
11925  __Pyx_GOTREF(__pyx_t_3);
11926  __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
11927  for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
11928  __pyx_t_4 = __pyx_t_6;
11929  __pyx_v_suboffset = (__pyx_t_4[0]);
11930  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 581, __pyx_L1_error)
11931  __Pyx_GOTREF(__pyx_t_2);
11932  if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(2, 581, __pyx_L1_error)
11933  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11934  }
11935  __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 581, __pyx_L1_error)
11936  __Pyx_GOTREF(__pyx_t_2);
11937  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11938  __pyx_r = __pyx_t_2;
11939  __pyx_t_2 = 0;
11940  goto __pyx_L0;
11941 
11942  /* "View.MemoryView":577
11943  *
11944  * @property
11945  * def suboffsets(self): # <<<<<<<<<<<<<<
11946  * if self.view.suboffsets == NULL:
11947  * return (-1,) * self.view.ndim
11948  */
11949 
11950  /* function exit code */
11951  __pyx_L1_error:;
11952  __Pyx_XDECREF(__pyx_t_2);
11953  __Pyx_XDECREF(__pyx_t_3);
11954  __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11955  __pyx_r = NULL;
11956  __pyx_L0:;
11957  __Pyx_XGIVEREF(__pyx_r);
11958  __Pyx_TraceReturn(__pyx_r, 0);
11959  __Pyx_RefNannyFinishContext();
11960  return __pyx_r;
11961 }
11962 
11963 /* "View.MemoryView":584
11964  *
11965  * @property
11966  * def ndim(self): # <<<<<<<<<<<<<<
11967  * return self.view.ndim
11968  *
11969  */
11970 
11971 /* Python wrapper */
11972 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
11973 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
11974  PyObject *__pyx_r = 0;
11975  __Pyx_RefNannyDeclarations
11976  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11977  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11978 
11979  /* function exit code */
11980  __Pyx_RefNannyFinishContext();
11981  return __pyx_r;
11982 }
11983 
11984 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11985  PyObject *__pyx_r = NULL;
11986  __Pyx_TraceDeclarations
11987  __Pyx_RefNannyDeclarations
11988  PyObject *__pyx_t_1 = NULL;
11989  int __pyx_lineno = 0;
11990  const char *__pyx_filename = NULL;
11991  int __pyx_clineno = 0;
11992  __Pyx_RefNannySetupContext("__get__", 0);
11993  __Pyx_TraceCall("__get__", __pyx_f[2], 584, 0, __PYX_ERR(2, 584, __pyx_L1_error));
11994 
11995  /* "View.MemoryView":585
11996  * @property
11997  * def ndim(self):
11998  * return self.view.ndim # <<<<<<<<<<<<<<
11999  *
12000  * @property
12001  */
12002  __Pyx_TraceLine(585,0,__PYX_ERR(2, 585, __pyx_L1_error))
12003  __Pyx_XDECREF(__pyx_r);
12004  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 585, __pyx_L1_error)
12005  __Pyx_GOTREF(__pyx_t_1);
12006  __pyx_r = __pyx_t_1;
12007  __pyx_t_1 = 0;
12008  goto __pyx_L0;
12009 
12010  /* "View.MemoryView":584
12011  *
12012  * @property
12013  * def ndim(self): # <<<<<<<<<<<<<<
12014  * return self.view.ndim
12015  *
12016  */
12017 
12018  /* function exit code */
12019  __pyx_L1_error:;
12020  __Pyx_XDECREF(__pyx_t_1);
12021  __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12022  __pyx_r = NULL;
12023  __pyx_L0:;
12024  __Pyx_XGIVEREF(__pyx_r);
12025  __Pyx_TraceReturn(__pyx_r, 0);
12026  __Pyx_RefNannyFinishContext();
12027  return __pyx_r;
12028 }
12029 
12030 /* "View.MemoryView":588
12031  *
12032  * @property
12033  * def itemsize(self): # <<<<<<<<<<<<<<
12034  * return self.view.itemsize
12035  *
12036  */
12037 
12038 /* Python wrapper */
12039 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
12040 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
12041  PyObject *__pyx_r = 0;
12042  __Pyx_RefNannyDeclarations
12043  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
12044  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12045 
12046  /* function exit code */
12047  __Pyx_RefNannyFinishContext();
12048  return __pyx_r;
12049 }
12050 
12051 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
12052  PyObject *__pyx_r = NULL;
12053  __Pyx_TraceDeclarations
12054  __Pyx_RefNannyDeclarations
12055  PyObject *__pyx_t_1 = NULL;
12056  int __pyx_lineno = 0;
12057  const char *__pyx_filename = NULL;
12058  int __pyx_clineno = 0;
12059  __Pyx_RefNannySetupContext("__get__", 0);
12060  __Pyx_TraceCall("__get__", __pyx_f[2], 588, 0, __PYX_ERR(2, 588, __pyx_L1_error));
12061 
12062  /* "View.MemoryView":589
12063  * @property
12064  * def itemsize(self):
12065  * return self.view.itemsize # <<<<<<<<<<<<<<
12066  *
12067  * @property
12068  */
12069  __Pyx_TraceLine(589,0,__PYX_ERR(2, 589, __pyx_L1_error))
12070  __Pyx_XDECREF(__pyx_r);
12071  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 589, __pyx_L1_error)
12072  __Pyx_GOTREF(__pyx_t_1);
12073  __pyx_r = __pyx_t_1;
12074  __pyx_t_1 = 0;
12075  goto __pyx_L0;
12076 
12077  /* "View.MemoryView":588
12078  *
12079  * @property
12080  * def itemsize(self): # <<<<<<<<<<<<<<
12081  * return self.view.itemsize
12082  *
12083  */
12084 
12085  /* function exit code */
12086  __pyx_L1_error:;
12087  __Pyx_XDECREF(__pyx_t_1);
12088  __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12089  __pyx_r = NULL;
12090  __pyx_L0:;
12091  __Pyx_XGIVEREF(__pyx_r);
12092  __Pyx_TraceReturn(__pyx_r, 0);
12093  __Pyx_RefNannyFinishContext();
12094  return __pyx_r;
12095 }
12096 
12097 /* "View.MemoryView":592
12098  *
12099  * @property
12100  * def nbytes(self): # <<<<<<<<<<<<<<
12101  * return self.size * self.view.itemsize
12102  *
12103  */
12104 
12105 /* Python wrapper */
12106 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
12107 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
12108  PyObject *__pyx_r = 0;
12109  __Pyx_RefNannyDeclarations
12110  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
12111  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12112 
12113  /* function exit code */
12114  __Pyx_RefNannyFinishContext();
12115  return __pyx_r;
12116 }
12117 
12118 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
12119  PyObject *__pyx_r = NULL;
12120  __Pyx_TraceDeclarations
12121  __Pyx_RefNannyDeclarations
12122  PyObject *__pyx_t_1 = NULL;
12123  PyObject *__pyx_t_2 = NULL;
12124  PyObject *__pyx_t_3 = NULL;
12125  int __pyx_lineno = 0;
12126  const char *__pyx_filename = NULL;
12127  int __pyx_clineno = 0;
12128  __Pyx_RefNannySetupContext("__get__", 0);
12129  __Pyx_TraceCall("__get__", __pyx_f[2], 592, 0, __PYX_ERR(2, 592, __pyx_L1_error));
12130 
12131  /* "View.MemoryView":593
12132  * @property
12133  * def nbytes(self):
12134  * return self.size * self.view.itemsize # <<<<<<<<<<<<<<
12135  *
12136  * @property
12137  */
12138  __Pyx_TraceLine(593,0,__PYX_ERR(2, 593, __pyx_L1_error))
12139  __Pyx_XDECREF(__pyx_r);
12140  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 593, __pyx_L1_error)
12141  __Pyx_GOTREF(__pyx_t_1);
12142  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 593, __pyx_L1_error)
12143  __Pyx_GOTREF(__pyx_t_2);
12144  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 593, __pyx_L1_error)
12145  __Pyx_GOTREF(__pyx_t_3);
12146  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12147  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12148  __pyx_r = __pyx_t_3;
12149  __pyx_t_3 = 0;
12150  goto __pyx_L0;
12151 
12152  /* "View.MemoryView":592
12153  *
12154  * @property
12155  * def nbytes(self): # <<<<<<<<<<<<<<
12156  * return self.size * self.view.itemsize
12157  *
12158  */
12159 
12160  /* function exit code */
12161  __pyx_L1_error:;
12162  __Pyx_XDECREF(__pyx_t_1);
12163  __Pyx_XDECREF(__pyx_t_2);
12164  __Pyx_XDECREF(__pyx_t_3);
12165  __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12166  __pyx_r = NULL;
12167  __pyx_L0:;
12168  __Pyx_XGIVEREF(__pyx_r);
12169  __Pyx_TraceReturn(__pyx_r, 0);
12170  __Pyx_RefNannyFinishContext();
12171  return __pyx_r;
12172 }
12173 
12174 /* "View.MemoryView":596
12175  *
12176  * @property
12177  * def size(self): # <<<<<<<<<<<<<<
12178  * if self._size is None:
12179  * result = 1
12180  */
12181 
12182 /* Python wrapper */
12183 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
12184 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
12185  PyObject *__pyx_r = 0;
12186  __Pyx_RefNannyDeclarations
12187  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
12188  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12189 
12190  /* function exit code */
12191  __Pyx_RefNannyFinishContext();
12192  return __pyx_r;
12193 }
12194 
12195 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
12196  PyObject *__pyx_v_result = NULL;
12197  PyObject *__pyx_v_length = NULL;
12198  PyObject *__pyx_r = NULL;
12199  __Pyx_TraceDeclarations
12200  __Pyx_RefNannyDeclarations
12201  int __pyx_t_1;
12202  int __pyx_t_2;
12203  Py_ssize_t *__pyx_t_3;
12204  Py_ssize_t *__pyx_t_4;
12205  Py_ssize_t *__pyx_t_5;
12206  PyObject *__pyx_t_6 = NULL;
12207  int __pyx_lineno = 0;
12208  const char *__pyx_filename = NULL;
12209  int __pyx_clineno = 0;
12210  __Pyx_RefNannySetupContext("__get__", 0);
12211  __Pyx_TraceCall("__get__", __pyx_f[2], 596, 0, __PYX_ERR(2, 596, __pyx_L1_error));
12212 
12213  /* "View.MemoryView":597
12214  * @property
12215  * def size(self):
12216  * if self._size is None: # <<<<<<<<<<<<<<
12217  * result = 1
12218  *
12219  */
12220  __Pyx_TraceLine(597,0,__PYX_ERR(2, 597, __pyx_L1_error))
12221  __pyx_t_1 = (__pyx_v_self->_size == Py_None);
12222  __pyx_t_2 = (__pyx_t_1 != 0);
12223  if (__pyx_t_2) {
12224 
12225  /* "View.MemoryView":598
12226  * def size(self):
12227  * if self._size is None:
12228  * result = 1 # <<<<<<<<<<<<<<
12229  *
12230  * for length in self.view.shape[:self.view.ndim]:
12231  */
12232  __Pyx_TraceLine(598,0,__PYX_ERR(2, 598, __pyx_L1_error))
12233  __Pyx_INCREF(__pyx_int_1);
12234  __pyx_v_result = __pyx_int_1;
12235 
12236  /* "View.MemoryView":600
12237  * result = 1
12238  *
12239  * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<<
12240  * result *= length
12241  *
12242  */
12243  __Pyx_TraceLine(600,0,__PYX_ERR(2, 600, __pyx_L1_error))
12244  __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
12245  for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
12246  __pyx_t_3 = __pyx_t_5;
12247  __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 600, __pyx_L1_error)
12248  __Pyx_GOTREF(__pyx_t_6);
12249  __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
12250  __pyx_t_6 = 0;
12251 
12252  /* "View.MemoryView":601
12253  *
12254  * for length in self.view.shape[:self.view.ndim]:
12255  * result *= length # <<<<<<<<<<<<<<
12256  *
12257  * self._size = result
12258  */
12259  __Pyx_TraceLine(601,0,__PYX_ERR(2, 601, __pyx_L1_error))
12260  __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 601, __pyx_L1_error)
12261  __Pyx_GOTREF(__pyx_t_6);
12262  __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
12263  __pyx_t_6 = 0;
12264  }
12265 
12266  /* "View.MemoryView":603
12267  * result *= length
12268  *
12269  * self._size = result # <<<<<<<<<<<<<<
12270  *
12271  * return self._size
12272  */
12273  __Pyx_TraceLine(603,0,__PYX_ERR(2, 603, __pyx_L1_error))
12274  __Pyx_INCREF(__pyx_v_result);
12275  __Pyx_GIVEREF(__pyx_v_result);
12276  __Pyx_GOTREF(__pyx_v_self->_size);
12277  __Pyx_DECREF(__pyx_v_self->_size);
12278  __pyx_v_self->_size = __pyx_v_result;
12279 
12280  /* "View.MemoryView":597
12281  * @property
12282  * def size(self):
12283  * if self._size is None: # <<<<<<<<<<<<<<
12284  * result = 1
12285  *
12286  */
12287  }
12288 
12289  /* "View.MemoryView":605
12290  * self._size = result
12291  *
12292  * return self._size # <<<<<<<<<<<<<<
12293  *
12294  * def __len__(self):
12295  */
12296  __Pyx_TraceLine(605,0,__PYX_ERR(2, 605, __pyx_L1_error))
12297  __Pyx_XDECREF(__pyx_r);
12298  __Pyx_INCREF(__pyx_v_self->_size);
12299  __pyx_r = __pyx_v_self->_size;
12300  goto __pyx_L0;
12301 
12302  /* "View.MemoryView":596
12303  *
12304  * @property
12305  * def size(self): # <<<<<<<<<<<<<<
12306  * if self._size is None:
12307  * result = 1
12308  */
12309 
12310  /* function exit code */
12311  __pyx_L1_error:;
12312  __Pyx_XDECREF(__pyx_t_6);
12313  __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12314  __pyx_r = NULL;
12315  __pyx_L0:;
12316  __Pyx_XDECREF(__pyx_v_result);
12317  __Pyx_XDECREF(__pyx_v_length);
12318  __Pyx_XGIVEREF(__pyx_r);
12319  __Pyx_TraceReturn(__pyx_r, 0);
12320  __Pyx_RefNannyFinishContext();
12321  return __pyx_r;
12322 }
12323 
12324 /* "View.MemoryView":607
12325  * return self._size
12326  *
12327  * def __len__(self): # <<<<<<<<<<<<<<
12328  * if self.view.ndim >= 1:
12329  * return self.view.shape[0]
12330  */
12331 
12332 /* Python wrapper */
12333 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
12334 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
12335  Py_ssize_t __pyx_r;
12336  __Pyx_RefNannyDeclarations
12337  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
12338  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12339 
12340  /* function exit code */
12341  __Pyx_RefNannyFinishContext();
12342  return __pyx_r;
12343 }
12344 
12345 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
12346  Py_ssize_t __pyx_r;
12347  __Pyx_TraceDeclarations
12348  __Pyx_RefNannyDeclarations
12349  int __pyx_t_1;
12350  int __pyx_lineno = 0;
12351  const char *__pyx_filename = NULL;
12352  int __pyx_clineno = 0;
12353  __Pyx_RefNannySetupContext("__len__", 0);
12354  __Pyx_TraceCall("__len__", __pyx_f[2], 607, 0, __PYX_ERR(2, 607, __pyx_L1_error));
12355 
12356  /* "View.MemoryView":608
12357  *
12358  * def __len__(self):
12359  * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
12360  * return self.view.shape[0]
12361  *
12362  */
12363  __Pyx_TraceLine(608,0,__PYX_ERR(2, 608, __pyx_L1_error))
12364  __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
12365  if (__pyx_t_1) {
12366 
12367  /* "View.MemoryView":609
12368  * def __len__(self):
12369  * if self.view.ndim >= 1:
12370  * return self.view.shape[0] # <<<<<<<<<<<<<<
12371  *
12372  * return 0
12373  */
12374  __Pyx_TraceLine(609,0,__PYX_ERR(2, 609, __pyx_L1_error))
12375  __pyx_r = (__pyx_v_self->view.shape[0]);
12376  goto __pyx_L0;
12377 
12378  /* "View.MemoryView":608
12379  *
12380  * def __len__(self):
12381  * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
12382  * return self.view.shape[0]
12383  *
12384  */
12385  }
12386 
12387  /* "View.MemoryView":611
12388  * return self.view.shape[0]
12389  *
12390  * return 0 # <<<<<<<<<<<<<<
12391  *
12392  * def __repr__(self):
12393  */
12394  __Pyx_TraceLine(611,0,__PYX_ERR(2, 611, __pyx_L1_error))
12395  __pyx_r = 0;
12396  goto __pyx_L0;
12397 
12398  /* "View.MemoryView":607
12399  * return self._size
12400  *
12401  * def __len__(self): # <<<<<<<<<<<<<<
12402  * if self.view.ndim >= 1:
12403  * return self.view.shape[0]
12404  */
12405 
12406  /* function exit code */
12407  __pyx_L1_error:;
12408  __Pyx_AddTraceback("View.MemoryView.memoryview.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12409  __pyx_r = -1;
12410  __pyx_L0:;
12411  __Pyx_TraceReturn(Py_None, 0);
12412  __Pyx_RefNannyFinishContext();
12413  return __pyx_r;
12414 }
12415 
12416 /* "View.MemoryView":613
12417  * return 0
12418  *
12419  * def __repr__(self): # <<<<<<<<<<<<<<
12420  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
12421  * id(self))
12422  */
12423 
12424 /* Python wrapper */
12425 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
12426 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
12427  PyObject *__pyx_r = 0;
12428  __Pyx_RefNannyDeclarations
12429  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
12430  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12431 
12432  /* function exit code */
12433  __Pyx_RefNannyFinishContext();
12434  return __pyx_r;
12435 }
12436 
12437 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
12438  PyObject *__pyx_r = NULL;
12439  __Pyx_TraceDeclarations
12440  __Pyx_RefNannyDeclarations
12441  PyObject *__pyx_t_1 = NULL;
12442  PyObject *__pyx_t_2 = NULL;
12443  PyObject *__pyx_t_3 = NULL;
12444  int __pyx_lineno = 0;
12445  const char *__pyx_filename = NULL;
12446  int __pyx_clineno = 0;
12447  __Pyx_RefNannySetupContext("__repr__", 0);
12448  __Pyx_TraceCall("__repr__", __pyx_f[2], 613, 0, __PYX_ERR(2, 613, __pyx_L1_error));
12449 
12450  /* "View.MemoryView":614
12451  *
12452  * def __repr__(self):
12453  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
12454  * id(self))
12455  *
12456  */
12457  __Pyx_TraceLine(614,0,__PYX_ERR(2, 614, __pyx_L1_error))
12458  __Pyx_XDECREF(__pyx_r);
12459  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 614, __pyx_L1_error)
12460  __Pyx_GOTREF(__pyx_t_1);
12461  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 614, __pyx_L1_error)
12462  __Pyx_GOTREF(__pyx_t_2);
12463  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12464  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 614, __pyx_L1_error)
12465  __Pyx_GOTREF(__pyx_t_1);
12466  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12467 
12468  /* "View.MemoryView":615
12469  * def __repr__(self):
12470  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
12471  * id(self)) # <<<<<<<<<<<<<<
12472  *
12473  * def __str__(self):
12474  */
12475  __Pyx_TraceLine(615,0,__PYX_ERR(2, 615, __pyx_L1_error))
12476  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 615, __pyx_L1_error)
12477  __Pyx_GOTREF(__pyx_t_2);
12478 
12479  /* "View.MemoryView":614
12480  *
12481  * def __repr__(self):
12482  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
12483  * id(self))
12484  *
12485  */
12486  __Pyx_TraceLine(614,0,__PYX_ERR(2, 614, __pyx_L1_error))
12487  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 614, __pyx_L1_error)
12488  __Pyx_GOTREF(__pyx_t_3);
12489  __Pyx_GIVEREF(__pyx_t_1);
12490  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
12491  __Pyx_GIVEREF(__pyx_t_2);
12492  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
12493  __pyx_t_1 = 0;
12494  __pyx_t_2 = 0;
12495  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 614, __pyx_L1_error)
12496  __Pyx_GOTREF(__pyx_t_2);
12497  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12498  __pyx_r = __pyx_t_2;
12499  __pyx_t_2 = 0;
12500  goto __pyx_L0;
12501 
12502  /* "View.MemoryView":613
12503  * return 0
12504  *
12505  * def __repr__(self): # <<<<<<<<<<<<<<
12506  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
12507  * id(self))
12508  */
12509 
12510  /* function exit code */
12511  __pyx_L1_error:;
12512  __Pyx_XDECREF(__pyx_t_1);
12513  __Pyx_XDECREF(__pyx_t_2);
12514  __Pyx_XDECREF(__pyx_t_3);
12515  __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12516  __pyx_r = NULL;
12517  __pyx_L0:;
12518  __Pyx_XGIVEREF(__pyx_r);
12519  __Pyx_TraceReturn(__pyx_r, 0);
12520  __Pyx_RefNannyFinishContext();
12521  return __pyx_r;
12522 }
12523 
12524 /* "View.MemoryView":617
12525  * id(self))
12526  *
12527  * def __str__(self): # <<<<<<<<<<<<<<
12528  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
12529  *
12530  */
12531 
12532 /* Python wrapper */
12533 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
12534 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
12535  PyObject *__pyx_r = 0;
12536  __Pyx_RefNannyDeclarations
12537  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
12538  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12539 
12540  /* function exit code */
12541  __Pyx_RefNannyFinishContext();
12542  return __pyx_r;
12543 }
12544 
12545 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
12546  PyObject *__pyx_r = NULL;
12547  __Pyx_TraceDeclarations
12548  __Pyx_RefNannyDeclarations
12549  PyObject *__pyx_t_1 = NULL;
12550  PyObject *__pyx_t_2 = NULL;
12551  int __pyx_lineno = 0;
12552  const char *__pyx_filename = NULL;
12553  int __pyx_clineno = 0;
12554  __Pyx_RefNannySetupContext("__str__", 0);
12555  __Pyx_TraceCall("__str__", __pyx_f[2], 617, 0, __PYX_ERR(2, 617, __pyx_L1_error));
12556 
12557  /* "View.MemoryView":618
12558  *
12559  * def __str__(self):
12560  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<<
12561  *
12562  *
12563  */
12564  __Pyx_TraceLine(618,0,__PYX_ERR(2, 618, __pyx_L1_error))
12565  __Pyx_XDECREF(__pyx_r);
12566  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 618, __pyx_L1_error)
12567  __Pyx_GOTREF(__pyx_t_1);
12568  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 618, __pyx_L1_error)
12569  __Pyx_GOTREF(__pyx_t_2);
12570  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12571  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 618, __pyx_L1_error)
12572  __Pyx_GOTREF(__pyx_t_1);
12573  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12574  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 618, __pyx_L1_error)
12575  __Pyx_GOTREF(__pyx_t_2);
12576  __Pyx_GIVEREF(__pyx_t_1);
12577  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
12578  __pyx_t_1 = 0;
12579  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 618, __pyx_L1_error)
12580  __Pyx_GOTREF(__pyx_t_1);
12581  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12582  __pyx_r = __pyx_t_1;
12583  __pyx_t_1 = 0;
12584  goto __pyx_L0;
12585 
12586  /* "View.MemoryView":617
12587  * id(self))
12588  *
12589  * def __str__(self): # <<<<<<<<<<<<<<
12590  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
12591  *
12592  */
12593 
12594  /* function exit code */
12595  __pyx_L1_error:;
12596  __Pyx_XDECREF(__pyx_t_1);
12597  __Pyx_XDECREF(__pyx_t_2);
12598  __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12599  __pyx_r = NULL;
12600  __pyx_L0:;
12601  __Pyx_XGIVEREF(__pyx_r);
12602  __Pyx_TraceReturn(__pyx_r, 0);
12603  __Pyx_RefNannyFinishContext();
12604  return __pyx_r;
12605 }
12606 
12607 /* "View.MemoryView":621
12608  *
12609  *
12610  * def is_c_contig(self): # <<<<<<<<<<<<<<
12611  * cdef __Pyx_memviewslice *mslice
12612  * cdef __Pyx_memviewslice tmp
12613  */
12614 
12615 /* Python wrapper */
12616 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
12617 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_17is_c_contig = {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0};
12618 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
12619  PyObject *__pyx_r = 0;
12620  __Pyx_RefNannyDeclarations
12621  __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
12622  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
12623 
12624  /* function exit code */
12625  __Pyx_RefNannyFinishContext();
12626  return __pyx_r;
12627 }
12628 
12629 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
12630  __Pyx_memviewslice *__pyx_v_mslice;
12631  __Pyx_memviewslice __pyx_v_tmp;
12632  PyObject *__pyx_r = NULL;
12633  __Pyx_TraceDeclarations
12634  __Pyx_RefNannyDeclarations
12635  __Pyx_memviewslice *__pyx_t_1;
12636  PyObject *__pyx_t_2 = NULL;
12637  int __pyx_lineno = 0;
12638  const char *__pyx_filename = NULL;
12639  int __pyx_clineno = 0;
12640  __Pyx_RefNannySetupContext("is_c_contig", 0);
12641  __Pyx_TraceCall("is_c_contig", __pyx_f[2], 621, 0, __PYX_ERR(2, 621, __pyx_L1_error));
12642 
12643  /* "View.MemoryView":624
12644  * cdef __Pyx_memviewslice *mslice
12645  * cdef __Pyx_memviewslice tmp
12646  * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
12647  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
12648  *
12649  */
12650  __Pyx_TraceLine(624,0,__PYX_ERR(2, 624, __pyx_L1_error))
12651  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 624, __pyx_L1_error)
12652  __pyx_v_mslice = __pyx_t_1;
12653 
12654  /* "View.MemoryView":625
12655  * cdef __Pyx_memviewslice tmp
12656  * mslice = get_slice_from_memview(self, &tmp)
12657  * return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<<
12658  *
12659  * def is_f_contig(self):
12660  */
12661  __Pyx_TraceLine(625,0,__PYX_ERR(2, 625, __pyx_L1_error))
12662  __Pyx_XDECREF(__pyx_r);
12663  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 625, __pyx_L1_error)
12664  __Pyx_GOTREF(__pyx_t_2);
12665  __pyx_r = __pyx_t_2;
12666  __pyx_t_2 = 0;
12667  goto __pyx_L0;
12668 
12669  /* "View.MemoryView":621
12670  *
12671  *
12672  * def is_c_contig(self): # <<<<<<<<<<<<<<
12673  * cdef __Pyx_memviewslice *mslice
12674  * cdef __Pyx_memviewslice tmp
12675  */
12676 
12677  /* function exit code */
12678  __pyx_L1_error:;
12679  __Pyx_XDECREF(__pyx_t_2);
12680  __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
12681  __pyx_r = NULL;
12682  __pyx_L0:;
12683  __Pyx_XGIVEREF(__pyx_r);
12684  __Pyx_TraceReturn(__pyx_r, 0);
12685  __Pyx_RefNannyFinishContext();
12686  return __pyx_r;
12687 }
12688 
12689 /* "View.MemoryView":627
12690  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
12691  *
12692  * def is_f_contig(self): # <<<<<<<<<<<<<<
12693  * cdef __Pyx_memviewslice *mslice
12694  * cdef __Pyx_memviewslice tmp
12695  */
12696 
12697 /* Python wrapper */
12698 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
12699 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_19is_f_contig = {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0};
12700 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
12701  PyObject *__pyx_r = 0;
12702  __Pyx_RefNannyDeclarations
12703  __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
12704  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
12705 
12706  /* function exit code */
12707  __Pyx_RefNannyFinishContext();
12708  return __pyx_r;
12709 }
12710 
12711 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
12712  __Pyx_memviewslice *__pyx_v_mslice;
12713  __Pyx_memviewslice __pyx_v_tmp;
12714  PyObject *__pyx_r = NULL;
12715  __Pyx_TraceDeclarations
12716  __Pyx_RefNannyDeclarations
12717  __Pyx_memviewslice *__pyx_t_1;
12718  PyObject *__pyx_t_2 = NULL;
12719  int __pyx_lineno = 0;
12720  const char *__pyx_filename = NULL;
12721  int __pyx_clineno = 0;
12722  __Pyx_RefNannySetupContext("is_f_contig", 0);
12723  __Pyx_TraceCall("is_f_contig", __pyx_f[2], 627, 0, __PYX_ERR(2, 627, __pyx_L1_error));
12724 
12725  /* "View.MemoryView":630
12726  * cdef __Pyx_memviewslice *mslice
12727  * cdef __Pyx_memviewslice tmp
12728  * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
12729  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
12730  *
12731  */
12732  __Pyx_TraceLine(630,0,__PYX_ERR(2, 630, __pyx_L1_error))
12733  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 630, __pyx_L1_error)
12734  __pyx_v_mslice = __pyx_t_1;
12735 
12736  /* "View.MemoryView":631
12737  * cdef __Pyx_memviewslice tmp
12738  * mslice = get_slice_from_memview(self, &tmp)
12739  * return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<<
12740  *
12741  * def copy(self):
12742  */
12743  __Pyx_TraceLine(631,0,__PYX_ERR(2, 631, __pyx_L1_error))
12744  __Pyx_XDECREF(__pyx_r);
12745  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 631, __pyx_L1_error)
12746  __Pyx_GOTREF(__pyx_t_2);
12747  __pyx_r = __pyx_t_2;
12748  __pyx_t_2 = 0;
12749  goto __pyx_L0;
12750 
12751  /* "View.MemoryView":627
12752  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
12753  *
12754  * def is_f_contig(self): # <<<<<<<<<<<<<<
12755  * cdef __Pyx_memviewslice *mslice
12756  * cdef __Pyx_memviewslice tmp
12757  */
12758 
12759  /* function exit code */
12760  __pyx_L1_error:;
12761  __Pyx_XDECREF(__pyx_t_2);
12762  __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
12763  __pyx_r = NULL;
12764  __pyx_L0:;
12765  __Pyx_XGIVEREF(__pyx_r);
12766  __Pyx_TraceReturn(__pyx_r, 0);
12767  __Pyx_RefNannyFinishContext();
12768  return __pyx_r;
12769 }
12770 
12771 /* "View.MemoryView":633
12772  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
12773  *
12774  * def copy(self): # <<<<<<<<<<<<<<
12775  * cdef __Pyx_memviewslice mslice
12776  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
12777  */
12778 
12779 /* Python wrapper */
12780 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
12781 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_21copy = {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0};
12782 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
12783  PyObject *__pyx_r = 0;
12784  __Pyx_RefNannyDeclarations
12785  __Pyx_RefNannySetupContext("copy (wrapper)", 0);
12786  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));
12787 
12788  /* function exit code */
12789  __Pyx_RefNannyFinishContext();
12790  return __pyx_r;
12791 }
12792 
12793 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
12794  __Pyx_memviewslice __pyx_v_mslice;
12795  int __pyx_v_flags;
12796  PyObject *__pyx_r = NULL;
12797  __Pyx_TraceDeclarations
12798  __Pyx_RefNannyDeclarations
12799  __Pyx_memviewslice __pyx_t_1;
12800  PyObject *__pyx_t_2 = NULL;
12801  int __pyx_lineno = 0;
12802  const char *__pyx_filename = NULL;
12803  int __pyx_clineno = 0;
12804  __Pyx_RefNannySetupContext("copy", 0);
12805  __Pyx_TraceCall("copy", __pyx_f[2], 633, 0, __PYX_ERR(2, 633, __pyx_L1_error));
12806 
12807  /* "View.MemoryView":635
12808  * def copy(self):
12809  * cdef __Pyx_memviewslice mslice
12810  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<<
12811  *
12812  * slice_copy(self, &mslice)
12813  */
12814  __Pyx_TraceLine(635,0,__PYX_ERR(2, 635, __pyx_L1_error))
12815  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
12816 
12817  /* "View.MemoryView":637
12818  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
12819  *
12820  * slice_copy(self, &mslice) # <<<<<<<<<<<<<<
12821  * mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
12822  * self.view.itemsize,
12823  */
12824  __Pyx_TraceLine(637,0,__PYX_ERR(2, 637, __pyx_L1_error))
12825  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
12826 
12827  /* "View.MemoryView":638
12828  *
12829  * slice_copy(self, &mslice)
12830  * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<<
12831  * self.view.itemsize,
12832  * flags|PyBUF_C_CONTIGUOUS,
12833  */
12834  __Pyx_TraceLine(638,0,__PYX_ERR(2, 638, __pyx_L1_error))
12835  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 638, __pyx_L1_error)
12836  __pyx_v_mslice = __pyx_t_1;
12837 
12838  /* "View.MemoryView":643
12839  * self.dtype_is_object)
12840  *
12841  * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<<
12842  *
12843  * def copy_fortran(self):
12844  */
12845  __Pyx_TraceLine(643,0,__PYX_ERR(2, 643, __pyx_L1_error))
12846  __Pyx_XDECREF(__pyx_r);
12847  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 643, __pyx_L1_error)
12848  __Pyx_GOTREF(__pyx_t_2);
12849  __pyx_r = __pyx_t_2;
12850  __pyx_t_2 = 0;
12851  goto __pyx_L0;
12852 
12853  /* "View.MemoryView":633
12854  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
12855  *
12856  * def copy(self): # <<<<<<<<<<<<<<
12857  * cdef __Pyx_memviewslice mslice
12858  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
12859  */
12860 
12861  /* function exit code */
12862  __pyx_L1_error:;
12863  __Pyx_XDECREF(__pyx_t_2);
12864  __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
12865  __pyx_r = NULL;
12866  __pyx_L0:;
12867  __Pyx_XGIVEREF(__pyx_r);
12868  __Pyx_TraceReturn(__pyx_r, 0);
12869  __Pyx_RefNannyFinishContext();
12870  return __pyx_r;
12871 }
12872 
12873 /* "View.MemoryView":645
12874  * return memoryview_copy_from_slice(self, &mslice)
12875  *
12876  * def copy_fortran(self): # <<<<<<<<<<<<<<
12877  * cdef __Pyx_memviewslice src, dst
12878  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
12879  */
12880 
12881 /* Python wrapper */
12882 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
12883 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_23copy_fortran = {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0};
12884 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
12885  PyObject *__pyx_r = 0;
12886  __Pyx_RefNannyDeclarations
12887  __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
12888  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));
12889 
12890  /* function exit code */
12891  __Pyx_RefNannyFinishContext();
12892  return __pyx_r;
12893 }
12894 
12895 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
12896  __Pyx_memviewslice __pyx_v_src;
12897  __Pyx_memviewslice __pyx_v_dst;
12898  int __pyx_v_flags;
12899  PyObject *__pyx_r = NULL;
12900  __Pyx_TraceDeclarations
12901  __Pyx_RefNannyDeclarations
12902  __Pyx_memviewslice __pyx_t_1;
12903  PyObject *__pyx_t_2 = NULL;
12904  int __pyx_lineno = 0;
12905  const char *__pyx_filename = NULL;
12906  int __pyx_clineno = 0;
12907  __Pyx_RefNannySetupContext("copy_fortran", 0);
12908  __Pyx_TraceCall("copy_fortran", __pyx_f[2], 645, 0, __PYX_ERR(2, 645, __pyx_L1_error));
12909 
12910  /* "View.MemoryView":647
12911  * def copy_fortran(self):
12912  * cdef __Pyx_memviewslice src, dst
12913  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<<
12914  *
12915  * slice_copy(self, &src)
12916  */
12917  __Pyx_TraceLine(647,0,__PYX_ERR(2, 647, __pyx_L1_error))
12918  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
12919 
12920  /* "View.MemoryView":649
12921  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
12922  *
12923  * slice_copy(self, &src) # <<<<<<<<<<<<<<
12924  * dst = slice_copy_contig(&src, "fortran", self.view.ndim,
12925  * self.view.itemsize,
12926  */
12927  __Pyx_TraceLine(649,0,__PYX_ERR(2, 649, __pyx_L1_error))
12928  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
12929 
12930  /* "View.MemoryView":650
12931  *
12932  * slice_copy(self, &src)
12933  * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<<
12934  * self.view.itemsize,
12935  * flags|PyBUF_F_CONTIGUOUS,
12936  */
12937  __Pyx_TraceLine(650,0,__PYX_ERR(2, 650, __pyx_L1_error))
12938  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 650, __pyx_L1_error)
12939  __pyx_v_dst = __pyx_t_1;
12940 
12941  /* "View.MemoryView":655
12942  * self.dtype_is_object)
12943  *
12944  * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<<
12945  *
12946  *
12947  */
12948  __Pyx_TraceLine(655,0,__PYX_ERR(2, 655, __pyx_L1_error))
12949  __Pyx_XDECREF(__pyx_r);
12950  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 655, __pyx_L1_error)
12951  __Pyx_GOTREF(__pyx_t_2);
12952  __pyx_r = __pyx_t_2;
12953  __pyx_t_2 = 0;
12954  goto __pyx_L0;
12955 
12956  /* "View.MemoryView":645
12957  * return memoryview_copy_from_slice(self, &mslice)
12958  *
12959  * def copy_fortran(self): # <<<<<<<<<<<<<<
12960  * cdef __Pyx_memviewslice src, dst
12961  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
12962  */
12963 
12964  /* function exit code */
12965  __pyx_L1_error:;
12966  __Pyx_XDECREF(__pyx_t_2);
12967  __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
12968  __pyx_r = NULL;
12969  __pyx_L0:;
12970  __Pyx_XGIVEREF(__pyx_r);
12971  __Pyx_TraceReturn(__pyx_r, 0);
12972  __Pyx_RefNannyFinishContext();
12973  return __pyx_r;
12974 }
12975 
12976 /* "(tree fragment)":1
12977  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
12978  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
12979  * def __setstate_cython__(self, __pyx_state):
12980  */
12981 
12982 /* Python wrapper */
12983 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
12984 static PyMethodDef __pyx_mdef___pyx_memoryview_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0};
12985 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
12986  PyObject *__pyx_r = 0;
12987  __Pyx_RefNannyDeclarations
12988  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
12989  __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12990 
12991  /* function exit code */
12992  __Pyx_RefNannyFinishContext();
12993  return __pyx_r;
12994 }
12995 
12996 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) {
12997  PyObject *__pyx_r = NULL;
12998  __Pyx_TraceDeclarations
12999  __Pyx_RefNannyDeclarations
13000  PyObject *__pyx_t_1 = NULL;
13001  int __pyx_lineno = 0;
13002  const char *__pyx_filename = NULL;
13003  int __pyx_clineno = 0;
13004  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
13005  __Pyx_TraceCall("__reduce_cython__", __pyx_f[2], 1, 0, __PYX_ERR(2, 1, __pyx_L1_error));
13006 
13007  /* "(tree fragment)":2
13008  * def __reduce_cython__(self):
13009  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
13010  * def __setstate_cython__(self, __pyx_state):
13011  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
13012  */
13013  __Pyx_TraceLine(2,0,__PYX_ERR(2, 2, __pyx_L1_error))
13014  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2, __pyx_L1_error)
13015  __Pyx_GOTREF(__pyx_t_1);
13016  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
13017  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13018  __PYX_ERR(2, 2, __pyx_L1_error)
13019 
13020  /* "(tree fragment)":1
13021  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
13022  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
13023  * def __setstate_cython__(self, __pyx_state):
13024  */
13025 
13026  /* function exit code */
13027  __pyx_L1_error:;
13028  __Pyx_XDECREF(__pyx_t_1);
13029  __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13030  __pyx_r = NULL;
13031  __Pyx_XGIVEREF(__pyx_r);
13032  __Pyx_TraceReturn(__pyx_r, 0);
13033  __Pyx_RefNannyFinishContext();
13034  return __pyx_r;
13035 }
13036 
13037 /* "(tree fragment)":3
13038  * def __reduce_cython__(self):
13039  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
13040  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
13041  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
13042  */
13043 
13044 /* Python wrapper */
13045 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
13046 static PyMethodDef __pyx_mdef___pyx_memoryview_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0};
13047 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
13048  PyObject *__pyx_r = 0;
13049  __Pyx_RefNannyDeclarations
13050  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
13051  __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
13052 
13053  /* function exit code */
13054  __Pyx_RefNannyFinishContext();
13055  return __pyx_r;
13056 }
13057 
13058 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
13059  PyObject *__pyx_r = NULL;
13060  __Pyx_TraceDeclarations
13061  __Pyx_RefNannyDeclarations
13062  PyObject *__pyx_t_1 = NULL;
13063  int __pyx_lineno = 0;
13064  const char *__pyx_filename = NULL;
13065  int __pyx_clineno = 0;
13066  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
13067  __Pyx_TraceCall("__setstate_cython__", __pyx_f[2], 3, 0, __PYX_ERR(2, 3, __pyx_L1_error));
13068 
13069  /* "(tree fragment)":4
13070  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
13071  * def __setstate_cython__(self, __pyx_state):
13072  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
13073  */
13074  __Pyx_TraceLine(4,0,__PYX_ERR(2, 4, __pyx_L1_error))
13075  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error)
13076  __Pyx_GOTREF(__pyx_t_1);
13077  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
13078  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13079  __PYX_ERR(2, 4, __pyx_L1_error)
13080 
13081  /* "(tree fragment)":3
13082  * def __reduce_cython__(self):
13083  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
13084  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
13085  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
13086  */
13087 
13088  /* function exit code */
13089  __pyx_L1_error:;
13090  __Pyx_XDECREF(__pyx_t_1);
13091  __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13092  __pyx_r = NULL;
13093  __Pyx_XGIVEREF(__pyx_r);
13094  __Pyx_TraceReturn(__pyx_r, 0);
13095  __Pyx_RefNannyFinishContext();
13096  return __pyx_r;
13097 }
13098 
13099 /* "View.MemoryView":659
13100  *
13101  * @cname('__pyx_memoryview_new')
13102  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
13103  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
13104  * result.typeinfo = typeinfo
13105  */
13106 
13107 static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
13108  struct __pyx_memoryview_obj *__pyx_v_result = 0;
13109  PyObject *__pyx_r = NULL;
13110  __Pyx_TraceDeclarations
13111  __Pyx_RefNannyDeclarations
13112  PyObject *__pyx_t_1 = NULL;
13113  PyObject *__pyx_t_2 = NULL;
13114  PyObject *__pyx_t_3 = NULL;
13115  int __pyx_lineno = 0;
13116  const char *__pyx_filename = NULL;
13117  int __pyx_clineno = 0;
13118  __Pyx_RefNannySetupContext("memoryview_cwrapper", 0);
13119  __Pyx_TraceCall("memoryview_cwrapper", __pyx_f[2], 659, 0, __PYX_ERR(2, 659, __pyx_L1_error));
13120 
13121  /* "View.MemoryView":660
13122  * @cname('__pyx_memoryview_new')
13123  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
13124  * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<<
13125  * result.typeinfo = typeinfo
13126  * return result
13127  */
13128  __Pyx_TraceLine(660,0,__PYX_ERR(2, 660, __pyx_L1_error))
13129  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 660, __pyx_L1_error)
13130  __Pyx_GOTREF(__pyx_t_1);
13131  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 660, __pyx_L1_error)
13132  __Pyx_GOTREF(__pyx_t_2);
13133  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 660, __pyx_L1_error)
13134  __Pyx_GOTREF(__pyx_t_3);
13135  __Pyx_INCREF(__pyx_v_o);
13136  __Pyx_GIVEREF(__pyx_v_o);
13137  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
13138  __Pyx_GIVEREF(__pyx_t_1);
13139  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
13140  __Pyx_GIVEREF(__pyx_t_2);
13141  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
13142  __pyx_t_1 = 0;
13143  __pyx_t_2 = 0;
13144  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 660, __pyx_L1_error)
13145  __Pyx_GOTREF(__pyx_t_2);
13146  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13147  __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2);
13148  __pyx_t_2 = 0;
13149 
13150  /* "View.MemoryView":661
13151  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
13152  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
13153  * result.typeinfo = typeinfo # <<<<<<<<<<<<<<
13154  * return result
13155  *
13156  */
13157  __Pyx_TraceLine(661,0,__PYX_ERR(2, 661, __pyx_L1_error))
13158  __pyx_v_result->typeinfo = __pyx_v_typeinfo;
13159 
13160  /* "View.MemoryView":662
13161  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
13162  * result.typeinfo = typeinfo
13163  * return result # <<<<<<<<<<<<<<
13164  *
13165  * @cname('__pyx_memoryview_check')
13166  */
13167  __Pyx_TraceLine(662,0,__PYX_ERR(2, 662, __pyx_L1_error))
13168  __Pyx_XDECREF(__pyx_r);
13169  __Pyx_INCREF(((PyObject *)__pyx_v_result));
13170  __pyx_r = ((PyObject *)__pyx_v_result);
13171  goto __pyx_L0;
13172 
13173  /* "View.MemoryView":659
13174  *
13175  * @cname('__pyx_memoryview_new')
13176  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
13177  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
13178  * result.typeinfo = typeinfo
13179  */
13180 
13181  /* function exit code */
13182  __pyx_L1_error:;
13183  __Pyx_XDECREF(__pyx_t_1);
13184  __Pyx_XDECREF(__pyx_t_2);
13185  __Pyx_XDECREF(__pyx_t_3);
13186  __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
13187  __pyx_r = 0;
13188  __pyx_L0:;
13189  __Pyx_XDECREF((PyObject *)__pyx_v_result);
13190  __Pyx_XGIVEREF(__pyx_r);
13191  __Pyx_TraceReturn(__pyx_r, 0);
13192  __Pyx_RefNannyFinishContext();
13193  return __pyx_r;
13194 }
13195 
13196 /* "View.MemoryView":665
13197  *
13198  * @cname('__pyx_memoryview_check')
13199  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
13200  * return isinstance(o, memoryview)
13201  *
13202  */
13203 
13204 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
13205  int __pyx_r;
13206  __Pyx_TraceDeclarations
13207  __Pyx_RefNannyDeclarations
13208  int __pyx_t_1;
13209  int __pyx_lineno = 0;
13210  const char *__pyx_filename = NULL;
13211  int __pyx_clineno = 0;
13212  __Pyx_RefNannySetupContext("memoryview_check", 0);
13213  __Pyx_TraceCall("memoryview_check", __pyx_f[2], 665, 0, __PYX_ERR(2, 665, __pyx_L1_error));
13214 
13215  /* "View.MemoryView":666
13216  * @cname('__pyx_memoryview_check')
13217  * cdef inline bint memoryview_check(object o):
13218  * return isinstance(o, memoryview) # <<<<<<<<<<<<<<
13219  *
13220  * cdef tuple _unellipsify(object index, int ndim):
13221  */
13222  __Pyx_TraceLine(666,0,__PYX_ERR(2, 666, __pyx_L1_error))
13223  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
13224  __pyx_r = __pyx_t_1;
13225  goto __pyx_L0;
13226 
13227  /* "View.MemoryView":665
13228  *
13229  * @cname('__pyx_memoryview_check')
13230  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
13231  * return isinstance(o, memoryview)
13232  *
13233  */
13234 
13235  /* function exit code */
13236  __pyx_L1_error:;
13237  __Pyx_WriteUnraisable("View.MemoryView.memoryview_check", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
13238  __pyx_r = 0;
13239  __pyx_L0:;
13240  __Pyx_TraceReturn(Py_None, 0);
13241  __Pyx_RefNannyFinishContext();
13242  return __pyx_r;
13243 }
13244 
13245 /* "View.MemoryView":668
13246  * return isinstance(o, memoryview)
13247  *
13248  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
13249  * """
13250  * Replace all ellipses with full slices and fill incomplete indices with
13251  */
13252 
13253 static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
13254  PyObject *__pyx_v_tup = NULL;
13255  PyObject *__pyx_v_result = NULL;
13256  int __pyx_v_have_slices;
13257  int __pyx_v_seen_ellipsis;
13258  CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
13259  PyObject *__pyx_v_item = NULL;
13260  Py_ssize_t __pyx_v_nslices;
13261  PyObject *__pyx_r = NULL;
13262  __Pyx_TraceDeclarations
13263  __Pyx_RefNannyDeclarations
13264  int __pyx_t_1;
13265  int __pyx_t_2;
13266  PyObject *__pyx_t_3 = NULL;
13267  PyObject *__pyx_t_4 = NULL;
13268  Py_ssize_t __pyx_t_5;
13269  PyObject *(*__pyx_t_6)(PyObject *);
13270  PyObject *__pyx_t_7 = NULL;
13271  Py_ssize_t __pyx_t_8;
13272  int __pyx_t_9;
13273  int __pyx_t_10;
13274  PyObject *__pyx_t_11 = NULL;
13275  int __pyx_lineno = 0;
13276  const char *__pyx_filename = NULL;
13277  int __pyx_clineno = 0;
13278  __Pyx_RefNannySetupContext("_unellipsify", 0);
13279  __Pyx_TraceCall("_unellipsify", __pyx_f[2], 668, 0, __PYX_ERR(2, 668, __pyx_L1_error));
13280 
13281  /* "View.MemoryView":673
13282  * full slices.
13283  * """
13284  * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
13285  * tup = (index,)
13286  * else:
13287  */
13288  __Pyx_TraceLine(673,0,__PYX_ERR(2, 673, __pyx_L1_error))
13289  __pyx_t_1 = PyTuple_Check(__pyx_v_index);
13290  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
13291  if (__pyx_t_2) {
13292 
13293  /* "View.MemoryView":674
13294  * """
13295  * if not isinstance(index, tuple):
13296  * tup = (index,) # <<<<<<<<<<<<<<
13297  * else:
13298  * tup = index
13299  */
13300  __Pyx_TraceLine(674,0,__PYX_ERR(2, 674, __pyx_L1_error))
13301  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 674, __pyx_L1_error)
13302  __Pyx_GOTREF(__pyx_t_3);
13303  __Pyx_INCREF(__pyx_v_index);
13304  __Pyx_GIVEREF(__pyx_v_index);
13305  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
13306  __pyx_v_tup = __pyx_t_3;
13307  __pyx_t_3 = 0;
13308 
13309  /* "View.MemoryView":673
13310  * full slices.
13311  * """
13312  * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
13313  * tup = (index,)
13314  * else:
13315  */
13316  goto __pyx_L3;
13317  }
13318 
13319  /* "View.MemoryView":676
13320  * tup = (index,)
13321  * else:
13322  * tup = index # <<<<<<<<<<<<<<
13323  *
13324  * result = []
13325  */
13326  __Pyx_TraceLine(676,0,__PYX_ERR(2, 676, __pyx_L1_error))
13327  /*else*/ {
13328  __Pyx_INCREF(__pyx_v_index);
13329  __pyx_v_tup = __pyx_v_index;
13330  }
13331  __pyx_L3:;
13332 
13333  /* "View.MemoryView":678
13334  * tup = index
13335  *
13336  * result = [] # <<<<<<<<<<<<<<
13337  * have_slices = False
13338  * seen_ellipsis = False
13339  */
13340  __Pyx_TraceLine(678,0,__PYX_ERR(2, 678, __pyx_L1_error))
13341  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 678, __pyx_L1_error)
13342  __Pyx_GOTREF(__pyx_t_3);
13343  __pyx_v_result = ((PyObject*)__pyx_t_3);
13344  __pyx_t_3 = 0;
13345 
13346  /* "View.MemoryView":679
13347  *
13348  * result = []
13349  * have_slices = False # <<<<<<<<<<<<<<
13350  * seen_ellipsis = False
13351  * for idx, item in enumerate(tup):
13352  */
13353  __Pyx_TraceLine(679,0,__PYX_ERR(2, 679, __pyx_L1_error))
13354  __pyx_v_have_slices = 0;
13355 
13356  /* "View.MemoryView":680
13357  * result = []
13358  * have_slices = False
13359  * seen_ellipsis = False # <<<<<<<<<<<<<<
13360  * for idx, item in enumerate(tup):
13361  * if item is Ellipsis:
13362  */
13363  __Pyx_TraceLine(680,0,__PYX_ERR(2, 680, __pyx_L1_error))
13364  __pyx_v_seen_ellipsis = 0;
13365 
13366  /* "View.MemoryView":681
13367  * have_slices = False
13368  * seen_ellipsis = False
13369  * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
13370  * if item is Ellipsis:
13371  * if not seen_ellipsis:
13372  */
13373  __Pyx_TraceLine(681,0,__PYX_ERR(2, 681, __pyx_L1_error))
13374  __Pyx_INCREF(__pyx_int_0);
13375  __pyx_t_3 = __pyx_int_0;
13376  if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
13377  __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
13378  __pyx_t_6 = NULL;
13379  } else {
13380  __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 681, __pyx_L1_error)
13381  __Pyx_GOTREF(__pyx_t_4);
13382  __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 681, __pyx_L1_error)
13383  }
13384  for (;;) {
13385  if (likely(!__pyx_t_6)) {
13386  if (likely(PyList_CheckExact(__pyx_t_4))) {
13387  if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
13388  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13389  __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 681, __pyx_L1_error)
13390  #else
13391  __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 681, __pyx_L1_error)
13392  __Pyx_GOTREF(__pyx_t_7);
13393  #endif
13394  } else {
13395  if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
13396  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13397  __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 681, __pyx_L1_error)
13398  #else
13399  __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 681, __pyx_L1_error)
13400  __Pyx_GOTREF(__pyx_t_7);
13401  #endif
13402  }
13403  } else {
13404  __pyx_t_7 = __pyx_t_6(__pyx_t_4);
13405  if (unlikely(!__pyx_t_7)) {
13406  PyObject* exc_type = PyErr_Occurred();
13407  if (exc_type) {
13408  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
13409  else __PYX_ERR(2, 681, __pyx_L1_error)
13410  }
13411  break;
13412  }
13413  __Pyx_GOTREF(__pyx_t_7);
13414  }
13415  __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
13416  __pyx_t_7 = 0;
13417  __Pyx_INCREF(__pyx_t_3);
13418  __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
13419  __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 681, __pyx_L1_error)
13420  __Pyx_GOTREF(__pyx_t_7);
13421  __Pyx_DECREF(__pyx_t_3);
13422  __pyx_t_3 = __pyx_t_7;
13423  __pyx_t_7 = 0;
13424 
13425  /* "View.MemoryView":682
13426  * seen_ellipsis = False
13427  * for idx, item in enumerate(tup):
13428  * if item is Ellipsis: # <<<<<<<<<<<<<<
13429  * if not seen_ellipsis:
13430  * result.extend([slice(None)] * (ndim - len(tup) + 1))
13431  */
13432  __Pyx_TraceLine(682,0,__PYX_ERR(2, 682, __pyx_L1_error))
13433  __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
13434  __pyx_t_1 = (__pyx_t_2 != 0);
13435  if (__pyx_t_1) {
13436 
13437  /* "View.MemoryView":683
13438  * for idx, item in enumerate(tup):
13439  * if item is Ellipsis:
13440  * if not seen_ellipsis: # <<<<<<<<<<<<<<
13441  * result.extend([slice(None)] * (ndim - len(tup) + 1))
13442  * seen_ellipsis = True
13443  */
13444  __Pyx_TraceLine(683,0,__PYX_ERR(2, 683, __pyx_L1_error))
13445  __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
13446  if (__pyx_t_1) {
13447 
13448  /* "View.MemoryView":684
13449  * if item is Ellipsis:
13450  * if not seen_ellipsis:
13451  * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
13452  * seen_ellipsis = True
13453  * else:
13454  */
13455  __Pyx_TraceLine(684,0,__PYX_ERR(2, 684, __pyx_L1_error))
13456  __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(2, 684, __pyx_L1_error)
13457  __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 684, __pyx_L1_error)
13458  __Pyx_GOTREF(__pyx_t_7);
13459  { Py_ssize_t __pyx_temp;
13460  for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
13461  __Pyx_INCREF(__pyx_slice__17);
13462  __Pyx_GIVEREF(__pyx_slice__17);
13463  PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__17);
13464  }
13465  }
13466  __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 684, __pyx_L1_error)
13467  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13468 
13469  /* "View.MemoryView":685
13470  * if not seen_ellipsis:
13471  * result.extend([slice(None)] * (ndim - len(tup) + 1))
13472  * seen_ellipsis = True # <<<<<<<<<<<<<<
13473  * else:
13474  * result.append(slice(None))
13475  */
13476  __Pyx_TraceLine(685,0,__PYX_ERR(2, 685, __pyx_L1_error))
13477  __pyx_v_seen_ellipsis = 1;
13478 
13479  /* "View.MemoryView":683
13480  * for idx, item in enumerate(tup):
13481  * if item is Ellipsis:
13482  * if not seen_ellipsis: # <<<<<<<<<<<<<<
13483  * result.extend([slice(None)] * (ndim - len(tup) + 1))
13484  * seen_ellipsis = True
13485  */
13486  goto __pyx_L7;
13487  }
13488 
13489  /* "View.MemoryView":687
13490  * seen_ellipsis = True
13491  * else:
13492  * result.append(slice(None)) # <<<<<<<<<<<<<<
13493  * have_slices = True
13494  * else:
13495  */
13496  __Pyx_TraceLine(687,0,__PYX_ERR(2, 687, __pyx_L1_error))
13497  /*else*/ {
13498  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__17); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 687, __pyx_L1_error)
13499  }
13500  __pyx_L7:;
13501 
13502  /* "View.MemoryView":688
13503  * else:
13504  * result.append(slice(None))
13505  * have_slices = True # <<<<<<<<<<<<<<
13506  * else:
13507  * if not isinstance(item, slice) and not PyIndex_Check(item):
13508  */
13509  __Pyx_TraceLine(688,0,__PYX_ERR(2, 688, __pyx_L1_error))
13510  __pyx_v_have_slices = 1;
13511 
13512  /* "View.MemoryView":682
13513  * seen_ellipsis = False
13514  * for idx, item in enumerate(tup):
13515  * if item is Ellipsis: # <<<<<<<<<<<<<<
13516  * if not seen_ellipsis:
13517  * result.extend([slice(None)] * (ndim - len(tup) + 1))
13518  */
13519  goto __pyx_L6;
13520  }
13521 
13522  /* "View.MemoryView":690
13523  * have_slices = True
13524  * else:
13525  * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
13526  * raise TypeError("Cannot index with type '%s'" % type(item))
13527  *
13528  */
13529  __Pyx_TraceLine(690,0,__PYX_ERR(2, 690, __pyx_L1_error))
13530  /*else*/ {
13531  __pyx_t_2 = PySlice_Check(__pyx_v_item);
13532  __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
13533  if (__pyx_t_10) {
13534  } else {
13535  __pyx_t_1 = __pyx_t_10;
13536  goto __pyx_L9_bool_binop_done;
13537  }
13538  __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
13539  __pyx_t_1 = __pyx_t_10;
13540  __pyx_L9_bool_binop_done:;
13541  if (unlikely(__pyx_t_1)) {
13542 
13543  /* "View.MemoryView":691
13544  * else:
13545  * if not isinstance(item, slice) and not PyIndex_Check(item):
13546  * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<<
13547  *
13548  * have_slices = have_slices or isinstance(item, slice)
13549  */
13550  __Pyx_TraceLine(691,0,__PYX_ERR(2, 691, __pyx_L1_error))
13551  __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 691, __pyx_L1_error)
13552  __Pyx_GOTREF(__pyx_t_7);
13553  __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 691, __pyx_L1_error)
13554  __Pyx_GOTREF(__pyx_t_11);
13555  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13556  __Pyx_Raise(__pyx_t_11, 0, 0, 0);
13557  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
13558  __PYX_ERR(2, 691, __pyx_L1_error)
13559 
13560  /* "View.MemoryView":690
13561  * have_slices = True
13562  * else:
13563  * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
13564  * raise TypeError("Cannot index with type '%s'" % type(item))
13565  *
13566  */
13567  }
13568 
13569  /* "View.MemoryView":693
13570  * raise TypeError("Cannot index with type '%s'" % type(item))
13571  *
13572  * have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<<
13573  * result.append(item)
13574  *
13575  */
13576  __Pyx_TraceLine(693,0,__PYX_ERR(2, 693, __pyx_L1_error))
13577  __pyx_t_10 = (__pyx_v_have_slices != 0);
13578  if (!__pyx_t_10) {
13579  } else {
13580  __pyx_t_1 = __pyx_t_10;
13581  goto __pyx_L11_bool_binop_done;
13582  }
13583  __pyx_t_10 = PySlice_Check(__pyx_v_item);
13584  __pyx_t_2 = (__pyx_t_10 != 0);
13585  __pyx_t_1 = __pyx_t_2;
13586  __pyx_L11_bool_binop_done:;
13587  __pyx_v_have_slices = __pyx_t_1;
13588 
13589  /* "View.MemoryView":694
13590  *
13591  * have_slices = have_slices or isinstance(item, slice)
13592  * result.append(item) # <<<<<<<<<<<<<<
13593  *
13594  * nslices = ndim - len(result)
13595  */
13596  __Pyx_TraceLine(694,0,__PYX_ERR(2, 694, __pyx_L1_error))
13597  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 694, __pyx_L1_error)
13598  }
13599  __pyx_L6:;
13600 
13601  /* "View.MemoryView":681
13602  * have_slices = False
13603  * seen_ellipsis = False
13604  * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
13605  * if item is Ellipsis:
13606  * if not seen_ellipsis:
13607  */
13608  __Pyx_TraceLine(681,0,__PYX_ERR(2, 681, __pyx_L1_error))
13609  }
13610  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13611  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13612 
13613  /* "View.MemoryView":696
13614  * result.append(item)
13615  *
13616  * nslices = ndim - len(result) # <<<<<<<<<<<<<<
13617  * if nslices:
13618  * result.extend([slice(None)] * nslices)
13619  */
13620  __Pyx_TraceLine(696,0,__PYX_ERR(2, 696, __pyx_L1_error))
13621  __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(2, 696, __pyx_L1_error)
13622  __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
13623 
13624  /* "View.MemoryView":697
13625  *
13626  * nslices = ndim - len(result)
13627  * if nslices: # <<<<<<<<<<<<<<
13628  * result.extend([slice(None)] * nslices)
13629  *
13630  */
13631  __Pyx_TraceLine(697,0,__PYX_ERR(2, 697, __pyx_L1_error))
13632  __pyx_t_1 = (__pyx_v_nslices != 0);
13633  if (__pyx_t_1) {
13634 
13635  /* "View.MemoryView":698
13636  * nslices = ndim - len(result)
13637  * if nslices:
13638  * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<<
13639  *
13640  * return have_slices or nslices, tuple(result)
13641  */
13642  __Pyx_TraceLine(698,0,__PYX_ERR(2, 698, __pyx_L1_error))
13643  __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 698, __pyx_L1_error)
13644  __Pyx_GOTREF(__pyx_t_3);
13645  { Py_ssize_t __pyx_temp;
13646  for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
13647  __Pyx_INCREF(__pyx_slice__17);
13648  __Pyx_GIVEREF(__pyx_slice__17);
13649  PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__17);
13650  }
13651  }
13652  __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 698, __pyx_L1_error)
13653  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13654 
13655  /* "View.MemoryView":697
13656  *
13657  * nslices = ndim - len(result)
13658  * if nslices: # <<<<<<<<<<<<<<
13659  * result.extend([slice(None)] * nslices)
13660  *
13661  */
13662  }
13663 
13664  /* "View.MemoryView":700
13665  * result.extend([slice(None)] * nslices)
13666  *
13667  * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<<
13668  *
13669  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
13670  */
13671  __Pyx_TraceLine(700,0,__PYX_ERR(2, 700, __pyx_L1_error))
13672  __Pyx_XDECREF(__pyx_r);
13673  if (!__pyx_v_have_slices) {
13674  } else {
13675  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 700, __pyx_L1_error)
13676  __Pyx_GOTREF(__pyx_t_4);
13677  __pyx_t_3 = __pyx_t_4;
13678  __pyx_t_4 = 0;
13679  goto __pyx_L14_bool_binop_done;
13680  }
13681  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 700, __pyx_L1_error)
13682  __Pyx_GOTREF(__pyx_t_4);
13683  __pyx_t_3 = __pyx_t_4;
13684  __pyx_t_4 = 0;
13685  __pyx_L14_bool_binop_done:;
13686  __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 700, __pyx_L1_error)
13687  __Pyx_GOTREF(__pyx_t_4);
13688  __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 700, __pyx_L1_error)
13689  __Pyx_GOTREF(__pyx_t_11);
13690  __Pyx_GIVEREF(__pyx_t_3);
13691  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
13692  __Pyx_GIVEREF(__pyx_t_4);
13693  PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
13694  __pyx_t_3 = 0;
13695  __pyx_t_4 = 0;
13696  __pyx_r = ((PyObject*)__pyx_t_11);
13697  __pyx_t_11 = 0;
13698  goto __pyx_L0;
13699 
13700  /* "View.MemoryView":668
13701  * return isinstance(o, memoryview)
13702  *
13703  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
13704  * """
13705  * Replace all ellipses with full slices and fill incomplete indices with
13706  */
13707 
13708  /* function exit code */
13709  __pyx_L1_error:;
13710  __Pyx_XDECREF(__pyx_t_3);
13711  __Pyx_XDECREF(__pyx_t_4);
13712  __Pyx_XDECREF(__pyx_t_7);
13713  __Pyx_XDECREF(__pyx_t_11);
13714  __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
13715  __pyx_r = 0;
13716  __pyx_L0:;
13717  __Pyx_XDECREF(__pyx_v_tup);
13718  __Pyx_XDECREF(__pyx_v_result);
13719  __Pyx_XDECREF(__pyx_v_idx);
13720  __Pyx_XDECREF(__pyx_v_item);
13721  __Pyx_XGIVEREF(__pyx_r);
13722  __Pyx_TraceReturn(__pyx_r, 0);
13723  __Pyx_RefNannyFinishContext();
13724  return __pyx_r;
13725 }
13726 
13727 /* "View.MemoryView":702
13728  * return have_slices or nslices, tuple(result)
13729  *
13730  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
13731  * for suboffset in suboffsets[:ndim]:
13732  * if suboffset >= 0:
13733  */
13734 
13735 static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
13736  Py_ssize_t __pyx_v_suboffset;
13737  PyObject *__pyx_r = NULL;
13738  __Pyx_TraceDeclarations
13739  __Pyx_RefNannyDeclarations
13740  Py_ssize_t *__pyx_t_1;
13741  Py_ssize_t *__pyx_t_2;
13742  Py_ssize_t *__pyx_t_3;
13743  int __pyx_t_4;
13744  PyObject *__pyx_t_5 = NULL;
13745  int __pyx_lineno = 0;
13746  const char *__pyx_filename = NULL;
13747  int __pyx_clineno = 0;
13748  __Pyx_RefNannySetupContext("assert_direct_dimensions", 0);
13749  __Pyx_TraceCall("assert_direct_dimensions", __pyx_f[2], 702, 0, __PYX_ERR(2, 702, __pyx_L1_error));
13750 
13751  /* "View.MemoryView":703
13752  *
13753  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
13754  * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<<
13755  * if suboffset >= 0:
13756  * raise ValueError("Indirect dimensions not supported")
13757  */
13758  __Pyx_TraceLine(703,0,__PYX_ERR(2, 703, __pyx_L1_error))
13759  __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
13760  for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
13761  __pyx_t_1 = __pyx_t_3;
13762  __pyx_v_suboffset = (__pyx_t_1[0]);
13763 
13764  /* "View.MemoryView":704
13765  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
13766  * for suboffset in suboffsets[:ndim]:
13767  * if suboffset >= 0: # <<<<<<<<<<<<<<
13768  * raise ValueError("Indirect dimensions not supported")
13769  *
13770  */
13771  __Pyx_TraceLine(704,0,__PYX_ERR(2, 704, __pyx_L1_error))
13772  __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
13773  if (unlikely(__pyx_t_4)) {
13774 
13775  /* "View.MemoryView":705
13776  * for suboffset in suboffsets[:ndim]:
13777  * if suboffset >= 0:
13778  * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
13779  *
13780  *
13781  */
13782  __Pyx_TraceLine(705,0,__PYX_ERR(2, 705, __pyx_L1_error))
13783  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 705, __pyx_L1_error)
13784  __Pyx_GOTREF(__pyx_t_5);
13785  __Pyx_Raise(__pyx_t_5, 0, 0, 0);
13786  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13787  __PYX_ERR(2, 705, __pyx_L1_error)
13788 
13789  /* "View.MemoryView":704
13790  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
13791  * for suboffset in suboffsets[:ndim]:
13792  * if suboffset >= 0: # <<<<<<<<<<<<<<
13793  * raise ValueError("Indirect dimensions not supported")
13794  *
13795  */
13796  }
13797  }
13798 
13799  /* "View.MemoryView":702
13800  * return have_slices or nslices, tuple(result)
13801  *
13802  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
13803  * for suboffset in suboffsets[:ndim]:
13804  * if suboffset >= 0:
13805  */
13806 
13807  /* function exit code */
13808  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13809  goto __pyx_L0;
13810  __pyx_L1_error:;
13811  __Pyx_XDECREF(__pyx_t_5);
13812  __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
13813  __pyx_r = 0;
13814  __pyx_L0:;
13815  __Pyx_XGIVEREF(__pyx_r);
13816  __Pyx_TraceReturn(__pyx_r, 0);
13817  __Pyx_RefNannyFinishContext();
13818  return __pyx_r;
13819 }
13820 
13821 /* "View.MemoryView":712
13822  *
13823  * @cname('__pyx_memview_slice')
13824  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
13825  * cdef int new_ndim = 0, suboffset_dim = -1, dim
13826  * cdef bint negative_step
13827  */
13828 
13829 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
13830  int __pyx_v_new_ndim;
13831  int __pyx_v_suboffset_dim;
13832  int __pyx_v_dim;
13833  __Pyx_memviewslice __pyx_v_src;
13834  __Pyx_memviewslice __pyx_v_dst;
13835  __Pyx_memviewslice *__pyx_v_p_src;
13836  struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
13837  __Pyx_memviewslice *__pyx_v_p_dst;
13838  int *__pyx_v_p_suboffset_dim;
13839  Py_ssize_t __pyx_v_start;
13840  Py_ssize_t __pyx_v_stop;
13841  Py_ssize_t __pyx_v_step;
13842  int __pyx_v_have_start;
13843  int __pyx_v_have_stop;
13844  int __pyx_v_have_step;
13845  PyObject *__pyx_v_index = NULL;
13846  struct __pyx_memoryview_obj *__pyx_r = NULL;
13847  __Pyx_TraceDeclarations
13848  __Pyx_RefNannyDeclarations
13849  int __pyx_t_1;
13850  int __pyx_t_2;
13851  PyObject *__pyx_t_3 = NULL;
13852  struct __pyx_memoryview_obj *__pyx_t_4;
13853  char *__pyx_t_5;
13854  int __pyx_t_6;
13855  Py_ssize_t __pyx_t_7;
13856  PyObject *(*__pyx_t_8)(PyObject *);
13857  PyObject *__pyx_t_9 = NULL;
13858  Py_ssize_t __pyx_t_10;
13859  int __pyx_t_11;
13860  Py_ssize_t __pyx_t_12;
13861  int __pyx_lineno = 0;
13862  const char *__pyx_filename = NULL;
13863  int __pyx_clineno = 0;
13864  __Pyx_RefNannySetupContext("memview_slice", 0);
13865  __Pyx_TraceCall("memview_slice", __pyx_f[2], 712, 0, __PYX_ERR(2, 712, __pyx_L1_error));
13866 
13867  /* "View.MemoryView":713
13868  * @cname('__pyx_memview_slice')
13869  * cdef memoryview memview_slice(memoryview memview, object indices):
13870  * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<<
13871  * cdef bint negative_step
13872  * cdef __Pyx_memviewslice src, dst
13873  */
13874  __Pyx_TraceLine(713,0,__PYX_ERR(2, 713, __pyx_L1_error))
13875  __pyx_v_new_ndim = 0;
13876  __pyx_v_suboffset_dim = -1;
13877 
13878  /* "View.MemoryView":720
13879  *
13880  *
13881  * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<<
13882  *
13883  * cdef _memoryviewslice memviewsliceobj
13884  */
13885  __Pyx_TraceLine(720,0,__PYX_ERR(2, 720, __pyx_L1_error))
13886  (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))));
13887 
13888  /* "View.MemoryView":724
13889  * cdef _memoryviewslice memviewsliceobj
13890  *
13891  * assert memview.view.ndim > 0 # <<<<<<<<<<<<<<
13892  *
13893  * if isinstance(memview, _memoryviewslice):
13894  */
13895  __Pyx_TraceLine(724,0,__PYX_ERR(2, 724, __pyx_L1_error))
13896  #ifndef CYTHON_WITHOUT_ASSERTIONS
13897  if (unlikely(__pyx_assertions_enabled())) {
13898  if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
13899  PyErr_SetNone(PyExc_AssertionError);
13900  __PYX_ERR(2, 724, __pyx_L1_error)
13901  }
13902  }
13903  #endif
13904 
13905  /* "View.MemoryView":726
13906  * assert memview.view.ndim > 0
13907  *
13908  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
13909  * memviewsliceobj = memview
13910  * p_src = &memviewsliceobj.from_slice
13911  */
13912  __Pyx_TraceLine(726,0,__PYX_ERR(2, 726, __pyx_L1_error))
13913  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
13914  __pyx_t_2 = (__pyx_t_1 != 0);
13915  if (__pyx_t_2) {
13916 
13917  /* "View.MemoryView":727
13918  *
13919  * if isinstance(memview, _memoryviewslice):
13920  * memviewsliceobj = memview # <<<<<<<<<<<<<<
13921  * p_src = &memviewsliceobj.from_slice
13922  * else:
13923  */
13924  __Pyx_TraceLine(727,0,__PYX_ERR(2, 727, __pyx_L1_error))
13925  if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 727, __pyx_L1_error)
13926  __pyx_t_3 = ((PyObject *)__pyx_v_memview);
13927  __Pyx_INCREF(__pyx_t_3);
13928  __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
13929  __pyx_t_3 = 0;
13930 
13931  /* "View.MemoryView":728
13932  * if isinstance(memview, _memoryviewslice):
13933  * memviewsliceobj = memview
13934  * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<<
13935  * else:
13936  * slice_copy(memview, &src)
13937  */
13938  __Pyx_TraceLine(728,0,__PYX_ERR(2, 728, __pyx_L1_error))
13939  __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
13940 
13941  /* "View.MemoryView":726
13942  * assert memview.view.ndim > 0
13943  *
13944  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
13945  * memviewsliceobj = memview
13946  * p_src = &memviewsliceobj.from_slice
13947  */
13948  goto __pyx_L3;
13949  }
13950 
13951  /* "View.MemoryView":730
13952  * p_src = &memviewsliceobj.from_slice
13953  * else:
13954  * slice_copy(memview, &src) # <<<<<<<<<<<<<<
13955  * p_src = &src
13956  *
13957  */
13958  __Pyx_TraceLine(730,0,__PYX_ERR(2, 730, __pyx_L1_error))
13959  /*else*/ {
13960  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
13961 
13962  /* "View.MemoryView":731
13963  * else:
13964  * slice_copy(memview, &src)
13965  * p_src = &src # <<<<<<<<<<<<<<
13966  *
13967  *
13968  */
13969  __Pyx_TraceLine(731,0,__PYX_ERR(2, 731, __pyx_L1_error))
13970  __pyx_v_p_src = (&__pyx_v_src);
13971  }
13972  __pyx_L3:;
13973 
13974  /* "View.MemoryView":737
13975  *
13976  *
13977  * dst.memview = p_src.memview # <<<<<<<<<<<<<<
13978  * dst.data = p_src.data
13979  *
13980  */
13981  __Pyx_TraceLine(737,0,__PYX_ERR(2, 737, __pyx_L1_error))
13982  __pyx_t_4 = __pyx_v_p_src->memview;
13983  __pyx_v_dst.memview = __pyx_t_4;
13984 
13985  /* "View.MemoryView":738
13986  *
13987  * dst.memview = p_src.memview
13988  * dst.data = p_src.data # <<<<<<<<<<<<<<
13989  *
13990  *
13991  */
13992  __Pyx_TraceLine(738,0,__PYX_ERR(2, 738, __pyx_L1_error))
13993  __pyx_t_5 = __pyx_v_p_src->data;
13994  __pyx_v_dst.data = __pyx_t_5;
13995 
13996  /* "View.MemoryView":743
13997  *
13998  *
13999  * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<<
14000  * cdef int *p_suboffset_dim = &suboffset_dim
14001  * cdef Py_ssize_t start, stop, step
14002  */
14003  __Pyx_TraceLine(743,0,__PYX_ERR(2, 743, __pyx_L1_error))
14004  __pyx_v_p_dst = (&__pyx_v_dst);
14005 
14006  /* "View.MemoryView":744
14007  *
14008  * cdef __Pyx_memviewslice *p_dst = &dst
14009  * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<<
14010  * cdef Py_ssize_t start, stop, step
14011  * cdef bint have_start, have_stop, have_step
14012  */
14013  __Pyx_TraceLine(744,0,__PYX_ERR(2, 744, __pyx_L1_error))
14014  __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
14015 
14016  /* "View.MemoryView":748
14017  * cdef bint have_start, have_stop, have_step
14018  *
14019  * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
14020  * if PyIndex_Check(index):
14021  * slice_memviewslice(
14022  */
14023  __Pyx_TraceLine(748,0,__PYX_ERR(2, 748, __pyx_L1_error))
14024  __pyx_t_6 = 0;
14025  if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
14026  __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
14027  __pyx_t_8 = NULL;
14028  } else {
14029  __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 748, __pyx_L1_error)
14030  __Pyx_GOTREF(__pyx_t_3);
14031  __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 748, __pyx_L1_error)
14032  }
14033  for (;;) {
14034  if (likely(!__pyx_t_8)) {
14035  if (likely(PyList_CheckExact(__pyx_t_3))) {
14036  if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
14037  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14038  __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(2, 748, __pyx_L1_error)
14039  #else
14040  __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 748, __pyx_L1_error)
14041  __Pyx_GOTREF(__pyx_t_9);
14042  #endif
14043  } else {
14044  if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
14045  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14046  __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(2, 748, __pyx_L1_error)
14047  #else
14048  __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 748, __pyx_L1_error)
14049  __Pyx_GOTREF(__pyx_t_9);
14050  #endif
14051  }
14052  } else {
14053  __pyx_t_9 = __pyx_t_8(__pyx_t_3);
14054  if (unlikely(!__pyx_t_9)) {
14055  PyObject* exc_type = PyErr_Occurred();
14056  if (exc_type) {
14057  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
14058  else __PYX_ERR(2, 748, __pyx_L1_error)
14059  }
14060  break;
14061  }
14062  __Pyx_GOTREF(__pyx_t_9);
14063  }
14064  __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
14065  __pyx_t_9 = 0;
14066  __pyx_v_dim = __pyx_t_6;
14067  __pyx_t_6 = (__pyx_t_6 + 1);
14068 
14069  /* "View.MemoryView":749
14070  *
14071  * for dim, index in enumerate(indices):
14072  * if PyIndex_Check(index): # <<<<<<<<<<<<<<
14073  * slice_memviewslice(
14074  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
14075  */
14076  __Pyx_TraceLine(749,0,__PYX_ERR(2, 749, __pyx_L1_error))
14077  __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
14078  if (__pyx_t_2) {
14079 
14080  /* "View.MemoryView":753
14081  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
14082  * dim, new_ndim, p_suboffset_dim,
14083  * index, 0, 0, # start, stop, step # <<<<<<<<<<<<<<
14084  * 0, 0, 0, # have_{start,stop,step}
14085  * False)
14086  */
14087  __Pyx_TraceLine(753,0,__PYX_ERR(2, 753, __pyx_L1_error))
14088  __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 753, __pyx_L1_error)
14089 
14090  /* "View.MemoryView":750
14091  * for dim, index in enumerate(indices):
14092  * if PyIndex_Check(index):
14093  * slice_memviewslice( # <<<<<<<<<<<<<<
14094  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
14095  * dim, new_ndim, p_suboffset_dim,
14096  */
14097  __Pyx_TraceLine(750,0,__PYX_ERR(2, 750, __pyx_L1_error))
14098  __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(2, 750, __pyx_L1_error)
14099 
14100  /* "View.MemoryView":749
14101  *
14102  * for dim, index in enumerate(indices):
14103  * if PyIndex_Check(index): # <<<<<<<<<<<<<<
14104  * slice_memviewslice(
14105  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
14106  */
14107  goto __pyx_L6;
14108  }
14109 
14110  /* "View.MemoryView":756
14111  * 0, 0, 0, # have_{start,stop,step}
14112  * False)
14113  * elif index is None: # <<<<<<<<<<<<<<
14114  * p_dst.shape[new_ndim] = 1
14115  * p_dst.strides[new_ndim] = 0
14116  */
14117  __Pyx_TraceLine(756,0,__PYX_ERR(2, 756, __pyx_L1_error))
14118  __pyx_t_2 = (__pyx_v_index == Py_None);
14119  __pyx_t_1 = (__pyx_t_2 != 0);
14120  if (__pyx_t_1) {
14121 
14122  /* "View.MemoryView":757
14123  * False)
14124  * elif index is None:
14125  * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<<
14126  * p_dst.strides[new_ndim] = 0
14127  * p_dst.suboffsets[new_ndim] = -1
14128  */
14129  __Pyx_TraceLine(757,0,__PYX_ERR(2, 757, __pyx_L1_error))
14130  (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
14131 
14132  /* "View.MemoryView":758
14133  * elif index is None:
14134  * p_dst.shape[new_ndim] = 1
14135  * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<<
14136  * p_dst.suboffsets[new_ndim] = -1
14137  * new_ndim += 1
14138  */
14139  __Pyx_TraceLine(758,0,__PYX_ERR(2, 758, __pyx_L1_error))
14140  (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
14141 
14142  /* "View.MemoryView":759
14143  * p_dst.shape[new_ndim] = 1
14144  * p_dst.strides[new_ndim] = 0
14145  * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<<
14146  * new_ndim += 1
14147  * else:
14148  */
14149  __Pyx_TraceLine(759,0,__PYX_ERR(2, 759, __pyx_L1_error))
14150  (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
14151 
14152  /* "View.MemoryView":760
14153  * p_dst.strides[new_ndim] = 0
14154  * p_dst.suboffsets[new_ndim] = -1
14155  * new_ndim += 1 # <<<<<<<<<<<<<<
14156  * else:
14157  * start = index.start or 0
14158  */
14159  __Pyx_TraceLine(760,0,__PYX_ERR(2, 760, __pyx_L1_error))
14160  __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
14161 
14162  /* "View.MemoryView":756
14163  * 0, 0, 0, # have_{start,stop,step}
14164  * False)
14165  * elif index is None: # <<<<<<<<<<<<<<
14166  * p_dst.shape[new_ndim] = 1
14167  * p_dst.strides[new_ndim] = 0
14168  */
14169  goto __pyx_L6;
14170  }
14171 
14172  /* "View.MemoryView":762
14173  * new_ndim += 1
14174  * else:
14175  * start = index.start or 0 # <<<<<<<<<<<<<<
14176  * stop = index.stop or 0
14177  * step = index.step or 0
14178  */
14179  __Pyx_TraceLine(762,0,__PYX_ERR(2, 762, __pyx_L1_error))
14180  /*else*/ {
14181  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 762, __pyx_L1_error)
14182  __Pyx_GOTREF(__pyx_t_9);
14183  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 762, __pyx_L1_error)
14184  if (!__pyx_t_1) {
14185  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14186  } else {
14187  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 762, __pyx_L1_error)
14188  __pyx_t_10 = __pyx_t_12;
14189  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14190  goto __pyx_L7_bool_binop_done;
14191  }
14192  __pyx_t_10 = 0;
14193  __pyx_L7_bool_binop_done:;
14194  __pyx_v_start = __pyx_t_10;
14195 
14196  /* "View.MemoryView":763
14197  * else:
14198  * start = index.start or 0
14199  * stop = index.stop or 0 # <<<<<<<<<<<<<<
14200  * step = index.step or 0
14201  *
14202  */
14203  __Pyx_TraceLine(763,0,__PYX_ERR(2, 763, __pyx_L1_error))
14204  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 763, __pyx_L1_error)
14205  __Pyx_GOTREF(__pyx_t_9);
14206  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 763, __pyx_L1_error)
14207  if (!__pyx_t_1) {
14208  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14209  } else {
14210  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 763, __pyx_L1_error)
14211  __pyx_t_10 = __pyx_t_12;
14212  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14213  goto __pyx_L9_bool_binop_done;
14214  }
14215  __pyx_t_10 = 0;
14216  __pyx_L9_bool_binop_done:;
14217  __pyx_v_stop = __pyx_t_10;
14218 
14219  /* "View.MemoryView":764
14220  * start = index.start or 0
14221  * stop = index.stop or 0
14222  * step = index.step or 0 # <<<<<<<<<<<<<<
14223  *
14224  * have_start = index.start is not None
14225  */
14226  __Pyx_TraceLine(764,0,__PYX_ERR(2, 764, __pyx_L1_error))
14227  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 764, __pyx_L1_error)
14228  __Pyx_GOTREF(__pyx_t_9);
14229  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 764, __pyx_L1_error)
14230  if (!__pyx_t_1) {
14231  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14232  } else {
14233  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 764, __pyx_L1_error)
14234  __pyx_t_10 = __pyx_t_12;
14235  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14236  goto __pyx_L11_bool_binop_done;
14237  }
14238  __pyx_t_10 = 0;
14239  __pyx_L11_bool_binop_done:;
14240  __pyx_v_step = __pyx_t_10;
14241 
14242  /* "View.MemoryView":766
14243  * step = index.step or 0
14244  *
14245  * have_start = index.start is not None # <<<<<<<<<<<<<<
14246  * have_stop = index.stop is not None
14247  * have_step = index.step is not None
14248  */
14249  __Pyx_TraceLine(766,0,__PYX_ERR(2, 766, __pyx_L1_error))
14250  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 766, __pyx_L1_error)
14251  __Pyx_GOTREF(__pyx_t_9);
14252  __pyx_t_1 = (__pyx_t_9 != Py_None);
14253  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14254  __pyx_v_have_start = __pyx_t_1;
14255 
14256  /* "View.MemoryView":767
14257  *
14258  * have_start = index.start is not None
14259  * have_stop = index.stop is not None # <<<<<<<<<<<<<<
14260  * have_step = index.step is not None
14261  *
14262  */
14263  __Pyx_TraceLine(767,0,__PYX_ERR(2, 767, __pyx_L1_error))
14264  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 767, __pyx_L1_error)
14265  __Pyx_GOTREF(__pyx_t_9);
14266  __pyx_t_1 = (__pyx_t_9 != Py_None);
14267  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14268  __pyx_v_have_stop = __pyx_t_1;
14269 
14270  /* "View.MemoryView":768
14271  * have_start = index.start is not None
14272  * have_stop = index.stop is not None
14273  * have_step = index.step is not None # <<<<<<<<<<<<<<
14274  *
14275  * slice_memviewslice(
14276  */
14277  __Pyx_TraceLine(768,0,__PYX_ERR(2, 768, __pyx_L1_error))
14278  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 768, __pyx_L1_error)
14279  __Pyx_GOTREF(__pyx_t_9);
14280  __pyx_t_1 = (__pyx_t_9 != Py_None);
14281  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14282  __pyx_v_have_step = __pyx_t_1;
14283 
14284  /* "View.MemoryView":770
14285  * have_step = index.step is not None
14286  *
14287  * slice_memviewslice( # <<<<<<<<<<<<<<
14288  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
14289  * dim, new_ndim, p_suboffset_dim,
14290  */
14291  __Pyx_TraceLine(770,0,__PYX_ERR(2, 770, __pyx_L1_error))
14292  __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(2, 770, __pyx_L1_error)
14293 
14294  /* "View.MemoryView":776
14295  * have_start, have_stop, have_step,
14296  * True)
14297  * new_ndim += 1 # <<<<<<<<<<<<<<
14298  *
14299  * if isinstance(memview, _memoryviewslice):
14300  */
14301  __Pyx_TraceLine(776,0,__PYX_ERR(2, 776, __pyx_L1_error))
14302  __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
14303  }
14304  __pyx_L6:;
14305 
14306  /* "View.MemoryView":748
14307  * cdef bint have_start, have_stop, have_step
14308  *
14309  * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
14310  * if PyIndex_Check(index):
14311  * slice_memviewslice(
14312  */
14313  __Pyx_TraceLine(748,0,__PYX_ERR(2, 748, __pyx_L1_error))
14314  }
14315  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14316 
14317  /* "View.MemoryView":778
14318  * new_ndim += 1
14319  *
14320  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
14321  * return memoryview_fromslice(dst, new_ndim,
14322  * memviewsliceobj.to_object_func,
14323  */
14324  __Pyx_TraceLine(778,0,__PYX_ERR(2, 778, __pyx_L1_error))
14325  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
14326  __pyx_t_2 = (__pyx_t_1 != 0);
14327  if (__pyx_t_2) {
14328 
14329  /* "View.MemoryView":779
14330  *
14331  * if isinstance(memview, _memoryviewslice):
14332  * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
14333  * memviewsliceobj.to_object_func,
14334  * memviewsliceobj.to_dtype_func,
14335  */
14336  __Pyx_TraceLine(779,0,__PYX_ERR(2, 779, __pyx_L1_error))
14337  __Pyx_XDECREF(((PyObject *)__pyx_r));
14338 
14339  /* "View.MemoryView":780
14340  * if isinstance(memview, _memoryviewslice):
14341  * return memoryview_fromslice(dst, new_ndim,
14342  * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<<
14343  * memviewsliceobj.to_dtype_func,
14344  * memview.dtype_is_object)
14345  */
14346  __Pyx_TraceLine(780,0,__PYX_ERR(2, 780, __pyx_L1_error))
14347  if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 780, __pyx_L1_error) }
14348 
14349  /* "View.MemoryView":781
14350  * return memoryview_fromslice(dst, new_ndim,
14351  * memviewsliceobj.to_object_func,
14352  * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<<
14353  * memview.dtype_is_object)
14354  * else:
14355  */
14356  __Pyx_TraceLine(781,0,__PYX_ERR(2, 781, __pyx_L1_error))
14357  if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 781, __pyx_L1_error) }
14358 
14359  /* "View.MemoryView":779
14360  *
14361  * if isinstance(memview, _memoryviewslice):
14362  * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
14363  * memviewsliceobj.to_object_func,
14364  * memviewsliceobj.to_dtype_func,
14365  */
14366  __Pyx_TraceLine(779,0,__PYX_ERR(2, 779, __pyx_L1_error))
14367  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 779, __pyx_L1_error)
14368  __Pyx_GOTREF(__pyx_t_3);
14369  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 779, __pyx_L1_error)
14370  __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
14371  __pyx_t_3 = 0;
14372  goto __pyx_L0;
14373 
14374  /* "View.MemoryView":778
14375  * new_ndim += 1
14376  *
14377  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
14378  * return memoryview_fromslice(dst, new_ndim,
14379  * memviewsliceobj.to_object_func,
14380  */
14381  }
14382 
14383  /* "View.MemoryView":784
14384  * memview.dtype_is_object)
14385  * else:
14386  * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
14387  * memview.dtype_is_object)
14388  *
14389  */
14390  __Pyx_TraceLine(784,0,__PYX_ERR(2, 784, __pyx_L1_error))
14391  /*else*/ {
14392  __Pyx_XDECREF(((PyObject *)__pyx_r));
14393 
14394  /* "View.MemoryView":785
14395  * else:
14396  * return memoryview_fromslice(dst, new_ndim, NULL, NULL,
14397  * memview.dtype_is_object) # <<<<<<<<<<<<<<
14398  *
14399  *
14400  */
14401  __Pyx_TraceLine(785,0,__PYX_ERR(2, 785, __pyx_L1_error))
14402  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 784, __pyx_L1_error)
14403  __Pyx_GOTREF(__pyx_t_3);
14404 
14405  /* "View.MemoryView":784
14406  * memview.dtype_is_object)
14407  * else:
14408  * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
14409  * memview.dtype_is_object)
14410  *
14411  */
14412  __Pyx_TraceLine(784,0,__PYX_ERR(2, 784, __pyx_L1_error))
14413  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 784, __pyx_L1_error)
14414  __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
14415  __pyx_t_3 = 0;
14416  goto __pyx_L0;
14417  }
14418 
14419  /* "View.MemoryView":712
14420  *
14421  * @cname('__pyx_memview_slice')
14422  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
14423  * cdef int new_ndim = 0, suboffset_dim = -1, dim
14424  * cdef bint negative_step
14425  */
14426 
14427  /* function exit code */
14428  __pyx_L1_error:;
14429  __Pyx_XDECREF(__pyx_t_3);
14430  __Pyx_XDECREF(__pyx_t_9);
14431  __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
14432  __pyx_r = 0;
14433  __pyx_L0:;
14434  __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
14435  __Pyx_XDECREF(__pyx_v_index);
14436  __Pyx_XGIVEREF((PyObject *)__pyx_r);
14437  __Pyx_TraceReturn(__pyx_r, 0);
14438  __Pyx_RefNannyFinishContext();
14439  return __pyx_r;
14440 }
14441 
14442 /* "View.MemoryView":809
14443  *
14444  * @cname('__pyx_memoryview_slice_memviewslice')
14445  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
14446  * __Pyx_memviewslice *dst,
14447  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
14448  */
14449 
14450 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset, int __pyx_v_dim, int __pyx_v_new_ndim, int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step, int __pyx_v_have_start, int __pyx_v_have_stop, int __pyx_v_have_step, int __pyx_v_is_slice) {
14451  Py_ssize_t __pyx_v_new_shape;
14452  int __pyx_v_negative_step;
14453  int __pyx_r;
14454  __Pyx_TraceDeclarations
14455  int __pyx_t_1;
14456  int __pyx_t_2;
14457  int __pyx_t_3;
14458  int __pyx_lineno = 0;
14459  const char *__pyx_filename = NULL;
14460  int __pyx_clineno = 0;
14461  __Pyx_TraceCall("slice_memviewslice", __pyx_f[2], 809, 1, __PYX_ERR(2, 809, __pyx_L1_error));
14462 
14463  /* "View.MemoryView":829
14464  * cdef bint negative_step
14465  *
14466  * if not is_slice: # <<<<<<<<<<<<<<
14467  *
14468  * if start < 0:
14469  */
14470  __Pyx_TraceLine(829,1,__PYX_ERR(2, 829, __pyx_L1_error))
14471  __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
14472  if (__pyx_t_1) {
14473 
14474  /* "View.MemoryView":831
14475  * if not is_slice:
14476  *
14477  * if start < 0: # <<<<<<<<<<<<<<
14478  * start += shape
14479  * if not 0 <= start < shape:
14480  */
14481  __Pyx_TraceLine(831,1,__PYX_ERR(2, 831, __pyx_L1_error))
14482  __pyx_t_1 = ((__pyx_v_start < 0) != 0);
14483  if (__pyx_t_1) {
14484 
14485  /* "View.MemoryView":832
14486  *
14487  * if start < 0:
14488  * start += shape # <<<<<<<<<<<<<<
14489  * if not 0 <= start < shape:
14490  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
14491  */
14492  __Pyx_TraceLine(832,1,__PYX_ERR(2, 832, __pyx_L1_error))
14493  __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
14494 
14495  /* "View.MemoryView":831
14496  * if not is_slice:
14497  *
14498  * if start < 0: # <<<<<<<<<<<<<<
14499  * start += shape
14500  * if not 0 <= start < shape:
14501  */
14502  }
14503 
14504  /* "View.MemoryView":833
14505  * if start < 0:
14506  * start += shape
14507  * if not 0 <= start < shape: # <<<<<<<<<<<<<<
14508  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
14509  * else:
14510  */
14511  __Pyx_TraceLine(833,1,__PYX_ERR(2, 833, __pyx_L1_error))
14512  __pyx_t_1 = (0 <= __pyx_v_start);
14513  if (__pyx_t_1) {
14514  __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
14515  }
14516  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
14517  if (__pyx_t_2) {
14518 
14519  /* "View.MemoryView":834
14520  * start += shape
14521  * if not 0 <= start < shape:
14522  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<<
14523  * else:
14524  *
14525  */
14526  __Pyx_TraceLine(834,1,__PYX_ERR(2, 834, __pyx_L1_error))
14527  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 834, __pyx_L1_error)
14528 
14529  /* "View.MemoryView":833
14530  * if start < 0:
14531  * start += shape
14532  * if not 0 <= start < shape: # <<<<<<<<<<<<<<
14533  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
14534  * else:
14535  */
14536  }
14537 
14538  /* "View.MemoryView":829
14539  * cdef bint negative_step
14540  *
14541  * if not is_slice: # <<<<<<<<<<<<<<
14542  *
14543  * if start < 0:
14544  */
14545  goto __pyx_L3;
14546  }
14547 
14548  /* "View.MemoryView":837
14549  * else:
14550  *
14551  * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<<
14552  *
14553  * if have_step and step == 0:
14554  */
14555  __Pyx_TraceLine(837,1,__PYX_ERR(2, 837, __pyx_L1_error))
14556  /*else*/ {
14557  __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
14558  if (__pyx_t_1) {
14559  } else {
14560  __pyx_t_2 = __pyx_t_1;
14561  goto __pyx_L6_bool_binop_done;
14562  }
14563  __pyx_t_1 = ((__pyx_v_step < 0) != 0);
14564  __pyx_t_2 = __pyx_t_1;
14565  __pyx_L6_bool_binop_done:;
14566  __pyx_v_negative_step = __pyx_t_2;
14567 
14568  /* "View.MemoryView":839
14569  * negative_step = have_step != 0 and step < 0
14570  *
14571  * if have_step and step == 0: # <<<<<<<<<<<<<<
14572  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
14573  *
14574  */
14575  __Pyx_TraceLine(839,1,__PYX_ERR(2, 839, __pyx_L1_error))
14576  __pyx_t_1 = (__pyx_v_have_step != 0);
14577  if (__pyx_t_1) {
14578  } else {
14579  __pyx_t_2 = __pyx_t_1;
14580  goto __pyx_L9_bool_binop_done;
14581  }
14582  __pyx_t_1 = ((__pyx_v_step == 0) != 0);
14583  __pyx_t_2 = __pyx_t_1;
14584  __pyx_L9_bool_binop_done:;
14585  if (__pyx_t_2) {
14586 
14587  /* "View.MemoryView":840
14588  *
14589  * if have_step and step == 0:
14590  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<<
14591  *
14592  *
14593  */
14594  __Pyx_TraceLine(840,1,__PYX_ERR(2, 840, __pyx_L1_error))
14595  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 840, __pyx_L1_error)
14596 
14597  /* "View.MemoryView":839
14598  * negative_step = have_step != 0 and step < 0
14599  *
14600  * if have_step and step == 0: # <<<<<<<<<<<<<<
14601  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
14602  *
14603  */
14604  }
14605 
14606  /* "View.MemoryView":843
14607  *
14608  *
14609  * if have_start: # <<<<<<<<<<<<<<
14610  * if start < 0:
14611  * start += shape
14612  */
14613  __Pyx_TraceLine(843,1,__PYX_ERR(2, 843, __pyx_L1_error))
14614  __pyx_t_2 = (__pyx_v_have_start != 0);
14615  if (__pyx_t_2) {
14616 
14617  /* "View.MemoryView":844
14618  *
14619  * if have_start:
14620  * if start < 0: # <<<<<<<<<<<<<<
14621  * start += shape
14622  * if start < 0:
14623  */
14624  __Pyx_TraceLine(844,1,__PYX_ERR(2, 844, __pyx_L1_error))
14625  __pyx_t_2 = ((__pyx_v_start < 0) != 0);
14626  if (__pyx_t_2) {
14627 
14628  /* "View.MemoryView":845
14629  * if have_start:
14630  * if start < 0:
14631  * start += shape # <<<<<<<<<<<<<<
14632  * if start < 0:
14633  * start = 0
14634  */
14635  __Pyx_TraceLine(845,1,__PYX_ERR(2, 845, __pyx_L1_error))
14636  __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
14637 
14638  /* "View.MemoryView":846
14639  * if start < 0:
14640  * start += shape
14641  * if start < 0: # <<<<<<<<<<<<<<
14642  * start = 0
14643  * elif start >= shape:
14644  */
14645  __Pyx_TraceLine(846,1,__PYX_ERR(2, 846, __pyx_L1_error))
14646  __pyx_t_2 = ((__pyx_v_start < 0) != 0);
14647  if (__pyx_t_2) {
14648 
14649  /* "View.MemoryView":847
14650  * start += shape
14651  * if start < 0:
14652  * start = 0 # <<<<<<<<<<<<<<
14653  * elif start >= shape:
14654  * if negative_step:
14655  */
14656  __Pyx_TraceLine(847,1,__PYX_ERR(2, 847, __pyx_L1_error))
14657  __pyx_v_start = 0;
14658 
14659  /* "View.MemoryView":846
14660  * if start < 0:
14661  * start += shape
14662  * if start < 0: # <<<<<<<<<<<<<<
14663  * start = 0
14664  * elif start >= shape:
14665  */
14666  }
14667 
14668  /* "View.MemoryView":844
14669  *
14670  * if have_start:
14671  * if start < 0: # <<<<<<<<<<<<<<
14672  * start += shape
14673  * if start < 0:
14674  */
14675  goto __pyx_L12;
14676  }
14677 
14678  /* "View.MemoryView":848
14679  * if start < 0:
14680  * start = 0
14681  * elif start >= shape: # <<<<<<<<<<<<<<
14682  * if negative_step:
14683  * start = shape - 1
14684  */
14685  __Pyx_TraceLine(848,1,__PYX_ERR(2, 848, __pyx_L1_error))
14686  __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
14687  if (__pyx_t_2) {
14688 
14689  /* "View.MemoryView":849
14690  * start = 0
14691  * elif start >= shape:
14692  * if negative_step: # <<<<<<<<<<<<<<
14693  * start = shape - 1
14694  * else:
14695  */
14696  __Pyx_TraceLine(849,1,__PYX_ERR(2, 849, __pyx_L1_error))
14697  __pyx_t_2 = (__pyx_v_negative_step != 0);
14698  if (__pyx_t_2) {
14699 
14700  /* "View.MemoryView":850
14701  * elif start >= shape:
14702  * if negative_step:
14703  * start = shape - 1 # <<<<<<<<<<<<<<
14704  * else:
14705  * start = shape
14706  */
14707  __Pyx_TraceLine(850,1,__PYX_ERR(2, 850, __pyx_L1_error))
14708  __pyx_v_start = (__pyx_v_shape - 1);
14709 
14710  /* "View.MemoryView":849
14711  * start = 0
14712  * elif start >= shape:
14713  * if negative_step: # <<<<<<<<<<<<<<
14714  * start = shape - 1
14715  * else:
14716  */
14717  goto __pyx_L14;
14718  }
14719 
14720  /* "View.MemoryView":852
14721  * start = shape - 1
14722  * else:
14723  * start = shape # <<<<<<<<<<<<<<
14724  * else:
14725  * if negative_step:
14726  */
14727  __Pyx_TraceLine(852,1,__PYX_ERR(2, 852, __pyx_L1_error))
14728  /*else*/ {
14729  __pyx_v_start = __pyx_v_shape;
14730  }
14731  __pyx_L14:;
14732 
14733  /* "View.MemoryView":848
14734  * if start < 0:
14735  * start = 0
14736  * elif start >= shape: # <<<<<<<<<<<<<<
14737  * if negative_step:
14738  * start = shape - 1
14739  */
14740  }
14741  __pyx_L12:;
14742 
14743  /* "View.MemoryView":843
14744  *
14745  *
14746  * if have_start: # <<<<<<<<<<<<<<
14747  * if start < 0:
14748  * start += shape
14749  */
14750  goto __pyx_L11;
14751  }
14752 
14753  /* "View.MemoryView":854
14754  * start = shape
14755  * else:
14756  * if negative_step: # <<<<<<<<<<<<<<
14757  * start = shape - 1
14758  * else:
14759  */
14760  __Pyx_TraceLine(854,1,__PYX_ERR(2, 854, __pyx_L1_error))
14761  /*else*/ {
14762  __pyx_t_2 = (__pyx_v_negative_step != 0);
14763  if (__pyx_t_2) {
14764 
14765  /* "View.MemoryView":855
14766  * else:
14767  * if negative_step:
14768  * start = shape - 1 # <<<<<<<<<<<<<<
14769  * else:
14770  * start = 0
14771  */
14772  __Pyx_TraceLine(855,1,__PYX_ERR(2, 855, __pyx_L1_error))
14773  __pyx_v_start = (__pyx_v_shape - 1);
14774 
14775  /* "View.MemoryView":854
14776  * start = shape
14777  * else:
14778  * if negative_step: # <<<<<<<<<<<<<<
14779  * start = shape - 1
14780  * else:
14781  */
14782  goto __pyx_L15;
14783  }
14784 
14785  /* "View.MemoryView":857
14786  * start = shape - 1
14787  * else:
14788  * start = 0 # <<<<<<<<<<<<<<
14789  *
14790  * if have_stop:
14791  */
14792  __Pyx_TraceLine(857,1,__PYX_ERR(2, 857, __pyx_L1_error))
14793  /*else*/ {
14794  __pyx_v_start = 0;
14795  }
14796  __pyx_L15:;
14797  }
14798  __pyx_L11:;
14799 
14800  /* "View.MemoryView":859
14801  * start = 0
14802  *
14803  * if have_stop: # <<<<<<<<<<<<<<
14804  * if stop < 0:
14805  * stop += shape
14806  */
14807  __Pyx_TraceLine(859,1,__PYX_ERR(2, 859, __pyx_L1_error))
14808  __pyx_t_2 = (__pyx_v_have_stop != 0);
14809  if (__pyx_t_2) {
14810 
14811  /* "View.MemoryView":860
14812  *
14813  * if have_stop:
14814  * if stop < 0: # <<<<<<<<<<<<<<
14815  * stop += shape
14816  * if stop < 0:
14817  */
14818  __Pyx_TraceLine(860,1,__PYX_ERR(2, 860, __pyx_L1_error))
14819  __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
14820  if (__pyx_t_2) {
14821 
14822  /* "View.MemoryView":861
14823  * if have_stop:
14824  * if stop < 0:
14825  * stop += shape # <<<<<<<<<<<<<<
14826  * if stop < 0:
14827  * stop = 0
14828  */
14829  __Pyx_TraceLine(861,1,__PYX_ERR(2, 861, __pyx_L1_error))
14830  __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
14831 
14832  /* "View.MemoryView":862
14833  * if stop < 0:
14834  * stop += shape
14835  * if stop < 0: # <<<<<<<<<<<<<<
14836  * stop = 0
14837  * elif stop > shape:
14838  */
14839  __Pyx_TraceLine(862,1,__PYX_ERR(2, 862, __pyx_L1_error))
14840  __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
14841  if (__pyx_t_2) {
14842 
14843  /* "View.MemoryView":863
14844  * stop += shape
14845  * if stop < 0:
14846  * stop = 0 # <<<<<<<<<<<<<<
14847  * elif stop > shape:
14848  * stop = shape
14849  */
14850  __Pyx_TraceLine(863,1,__PYX_ERR(2, 863, __pyx_L1_error))
14851  __pyx_v_stop = 0;
14852 
14853  /* "View.MemoryView":862
14854  * if stop < 0:
14855  * stop += shape
14856  * if stop < 0: # <<<<<<<<<<<<<<
14857  * stop = 0
14858  * elif stop > shape:
14859  */
14860  }
14861 
14862  /* "View.MemoryView":860
14863  *
14864  * if have_stop:
14865  * if stop < 0: # <<<<<<<<<<<<<<
14866  * stop += shape
14867  * if stop < 0:
14868  */
14869  goto __pyx_L17;
14870  }
14871 
14872  /* "View.MemoryView":864
14873  * if stop < 0:
14874  * stop = 0
14875  * elif stop > shape: # <<<<<<<<<<<<<<
14876  * stop = shape
14877  * else:
14878  */
14879  __Pyx_TraceLine(864,1,__PYX_ERR(2, 864, __pyx_L1_error))
14880  __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
14881  if (__pyx_t_2) {
14882 
14883  /* "View.MemoryView":865
14884  * stop = 0
14885  * elif stop > shape:
14886  * stop = shape # <<<<<<<<<<<<<<
14887  * else:
14888  * if negative_step:
14889  */
14890  __Pyx_TraceLine(865,1,__PYX_ERR(2, 865, __pyx_L1_error))
14891  __pyx_v_stop = __pyx_v_shape;
14892 
14893  /* "View.MemoryView":864
14894  * if stop < 0:
14895  * stop = 0
14896  * elif stop > shape: # <<<<<<<<<<<<<<
14897  * stop = shape
14898  * else:
14899  */
14900  }
14901  __pyx_L17:;
14902 
14903  /* "View.MemoryView":859
14904  * start = 0
14905  *
14906  * if have_stop: # <<<<<<<<<<<<<<
14907  * if stop < 0:
14908  * stop += shape
14909  */
14910  goto __pyx_L16;
14911  }
14912 
14913  /* "View.MemoryView":867
14914  * stop = shape
14915  * else:
14916  * if negative_step: # <<<<<<<<<<<<<<
14917  * stop = -1
14918  * else:
14919  */
14920  __Pyx_TraceLine(867,1,__PYX_ERR(2, 867, __pyx_L1_error))
14921  /*else*/ {
14922  __pyx_t_2 = (__pyx_v_negative_step != 0);
14923  if (__pyx_t_2) {
14924 
14925  /* "View.MemoryView":868
14926  * else:
14927  * if negative_step:
14928  * stop = -1 # <<<<<<<<<<<<<<
14929  * else:
14930  * stop = shape
14931  */
14932  __Pyx_TraceLine(868,1,__PYX_ERR(2, 868, __pyx_L1_error))
14933  __pyx_v_stop = -1L;
14934 
14935  /* "View.MemoryView":867
14936  * stop = shape
14937  * else:
14938  * if negative_step: # <<<<<<<<<<<<<<
14939  * stop = -1
14940  * else:
14941  */
14942  goto __pyx_L19;
14943  }
14944 
14945  /* "View.MemoryView":870
14946  * stop = -1
14947  * else:
14948  * stop = shape # <<<<<<<<<<<<<<
14949  *
14950  * if not have_step:
14951  */
14952  __Pyx_TraceLine(870,1,__PYX_ERR(2, 870, __pyx_L1_error))
14953  /*else*/ {
14954  __pyx_v_stop = __pyx_v_shape;
14955  }
14956  __pyx_L19:;
14957  }
14958  __pyx_L16:;
14959 
14960  /* "View.MemoryView":872
14961  * stop = shape
14962  *
14963  * if not have_step: # <<<<<<<<<<<<<<
14964  * step = 1
14965  *
14966  */
14967  __Pyx_TraceLine(872,1,__PYX_ERR(2, 872, __pyx_L1_error))
14968  __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
14969  if (__pyx_t_2) {
14970 
14971  /* "View.MemoryView":873
14972  *
14973  * if not have_step:
14974  * step = 1 # <<<<<<<<<<<<<<
14975  *
14976  *
14977  */
14978  __Pyx_TraceLine(873,1,__PYX_ERR(2, 873, __pyx_L1_error))
14979  __pyx_v_step = 1;
14980 
14981  /* "View.MemoryView":872
14982  * stop = shape
14983  *
14984  * if not have_step: # <<<<<<<<<<<<<<
14985  * step = 1
14986  *
14987  */
14988  }
14989 
14990  /* "View.MemoryView":877
14991  *
14992  * with cython.cdivision(True):
14993  * new_shape = (stop - start) // step # <<<<<<<<<<<<<<
14994  *
14995  * if (stop - start) - step * new_shape:
14996  */
14997  __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
14998 
14999  /* "View.MemoryView":879
15000  * new_shape = (stop - start) // step
15001  *
15002  * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
15003  * new_shape += 1
15004  *
15005  */
15006  __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
15007  if (__pyx_t_2) {
15008 
15009  /* "View.MemoryView":880
15010  *
15011  * if (stop - start) - step * new_shape:
15012  * new_shape += 1 # <<<<<<<<<<<<<<
15013  *
15014  * if new_shape < 0:
15015  */
15016  __pyx_v_new_shape = (__pyx_v_new_shape + 1);
15017 
15018  /* "View.MemoryView":879
15019  * new_shape = (stop - start) // step
15020  *
15021  * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
15022  * new_shape += 1
15023  *
15024  */
15025  }
15026 
15027  /* "View.MemoryView":882
15028  * new_shape += 1
15029  *
15030  * if new_shape < 0: # <<<<<<<<<<<<<<
15031  * new_shape = 0
15032  *
15033  */
15034  __Pyx_TraceLine(882,1,__PYX_ERR(2, 882, __pyx_L1_error))
15035  __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
15036  if (__pyx_t_2) {
15037 
15038  /* "View.MemoryView":883
15039  *
15040  * if new_shape < 0:
15041  * new_shape = 0 # <<<<<<<<<<<<<<
15042  *
15043  *
15044  */
15045  __Pyx_TraceLine(883,1,__PYX_ERR(2, 883, __pyx_L1_error))
15046  __pyx_v_new_shape = 0;
15047 
15048  /* "View.MemoryView":882
15049  * new_shape += 1
15050  *
15051  * if new_shape < 0: # <<<<<<<<<<<<<<
15052  * new_shape = 0
15053  *
15054  */
15055  }
15056 
15057  /* "View.MemoryView":886
15058  *
15059  *
15060  * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<<
15061  * dst.shape[new_ndim] = new_shape
15062  * dst.suboffsets[new_ndim] = suboffset
15063  */
15064  __Pyx_TraceLine(886,1,__PYX_ERR(2, 886, __pyx_L1_error))
15065  (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
15066 
15067  /* "View.MemoryView":887
15068  *
15069  * dst.strides[new_ndim] = stride * step
15070  * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<<
15071  * dst.suboffsets[new_ndim] = suboffset
15072  *
15073  */
15074  __Pyx_TraceLine(887,1,__PYX_ERR(2, 887, __pyx_L1_error))
15075  (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
15076 
15077  /* "View.MemoryView":888
15078  * dst.strides[new_ndim] = stride * step
15079  * dst.shape[new_ndim] = new_shape
15080  * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<<
15081  *
15082  *
15083  */
15084  __Pyx_TraceLine(888,1,__PYX_ERR(2, 888, __pyx_L1_error))
15085  (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
15086  }
15087  __pyx_L3:;
15088 
15089  /* "View.MemoryView":891
15090  *
15091  *
15092  * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
15093  * dst.data += start * stride
15094  * else:
15095  */
15096  __Pyx_TraceLine(891,1,__PYX_ERR(2, 891, __pyx_L1_error))
15097  __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
15098  if (__pyx_t_2) {
15099 
15100  /* "View.MemoryView":892
15101  *
15102  * if suboffset_dim[0] < 0:
15103  * dst.data += start * stride # <<<<<<<<<<<<<<
15104  * else:
15105  * dst.suboffsets[suboffset_dim[0]] += start * stride
15106  */
15107  __Pyx_TraceLine(892,1,__PYX_ERR(2, 892, __pyx_L1_error))
15108  __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
15109 
15110  /* "View.MemoryView":891
15111  *
15112  *
15113  * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
15114  * dst.data += start * stride
15115  * else:
15116  */
15117  goto __pyx_L23;
15118  }
15119 
15120  /* "View.MemoryView":894
15121  * dst.data += start * stride
15122  * else:
15123  * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<<
15124  *
15125  * if suboffset >= 0:
15126  */
15127  __Pyx_TraceLine(894,1,__PYX_ERR(2, 894, __pyx_L1_error))
15128  /*else*/ {
15129  __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
15130  (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
15131  }
15132  __pyx_L23:;
15133 
15134  /* "View.MemoryView":896
15135  * dst.suboffsets[suboffset_dim[0]] += start * stride
15136  *
15137  * if suboffset >= 0: # <<<<<<<<<<<<<<
15138  * if not is_slice:
15139  * if new_ndim == 0:
15140  */
15141  __Pyx_TraceLine(896,1,__PYX_ERR(2, 896, __pyx_L1_error))
15142  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
15143  if (__pyx_t_2) {
15144 
15145  /* "View.MemoryView":897
15146  *
15147  * if suboffset >= 0:
15148  * if not is_slice: # <<<<<<<<<<<<<<
15149  * if new_ndim == 0:
15150  * dst.data = (<char **> dst.data)[0] + suboffset
15151  */
15152  __Pyx_TraceLine(897,1,__PYX_ERR(2, 897, __pyx_L1_error))
15153  __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
15154  if (__pyx_t_2) {
15155 
15156  /* "View.MemoryView":898
15157  * if suboffset >= 0:
15158  * if not is_slice:
15159  * if new_ndim == 0: # <<<<<<<<<<<<<<
15160  * dst.data = (<char **> dst.data)[0] + suboffset
15161  * else:
15162  */
15163  __Pyx_TraceLine(898,1,__PYX_ERR(2, 898, __pyx_L1_error))
15164  __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
15165  if (__pyx_t_2) {
15166 
15167  /* "View.MemoryView":899
15168  * if not is_slice:
15169  * if new_ndim == 0:
15170  * dst.data = (<char **> dst.data)[0] + suboffset # <<<<<<<<<<<<<<
15171  * else:
15172  * _err_dim(IndexError, "All dimensions preceding dimension %d "
15173  */
15174  __Pyx_TraceLine(899,1,__PYX_ERR(2, 899, __pyx_L1_error))
15175  __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
15176 
15177  /* "View.MemoryView":898
15178  * if suboffset >= 0:
15179  * if not is_slice:
15180  * if new_ndim == 0: # <<<<<<<<<<<<<<
15181  * dst.data = (<char **> dst.data)[0] + suboffset
15182  * else:
15183  */
15184  goto __pyx_L26;
15185  }
15186 
15187  /* "View.MemoryView":901
15188  * dst.data = (<char **> dst.data)[0] + suboffset
15189  * else:
15190  * _err_dim(IndexError, "All dimensions preceding dimension %d " # <<<<<<<<<<<<<<
15191  * "must be indexed and not sliced", dim)
15192  * else:
15193  */
15194  __Pyx_TraceLine(901,1,__PYX_ERR(2, 901, __pyx_L1_error))
15195  /*else*/ {
15196 
15197  /* "View.MemoryView":902
15198  * else:
15199  * _err_dim(IndexError, "All dimensions preceding dimension %d "
15200  * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<<
15201  * else:
15202  * suboffset_dim[0] = new_ndim
15203  */
15204  __Pyx_TraceLine(902,1,__PYX_ERR(2, 902, __pyx_L1_error))
15205  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 901, __pyx_L1_error)
15206  }
15207  __pyx_L26:;
15208 
15209  /* "View.MemoryView":897
15210  *
15211  * if suboffset >= 0:
15212  * if not is_slice: # <<<<<<<<<<<<<<
15213  * if new_ndim == 0:
15214  * dst.data = (<char **> dst.data)[0] + suboffset
15215  */
15216  goto __pyx_L25;
15217  }
15218 
15219  /* "View.MemoryView":904
15220  * "must be indexed and not sliced", dim)
15221  * else:
15222  * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<<
15223  *
15224  * return 0
15225  */
15226  __Pyx_TraceLine(904,1,__PYX_ERR(2, 904, __pyx_L1_error))
15227  /*else*/ {
15228  (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
15229  }
15230  __pyx_L25:;
15231 
15232  /* "View.MemoryView":896
15233  * dst.suboffsets[suboffset_dim[0]] += start * stride
15234  *
15235  * if suboffset >= 0: # <<<<<<<<<<<<<<
15236  * if not is_slice:
15237  * if new_ndim == 0:
15238  */
15239  }
15240 
15241  /* "View.MemoryView":906
15242  * suboffset_dim[0] = new_ndim
15243  *
15244  * return 0 # <<<<<<<<<<<<<<
15245  *
15246  *
15247  */
15248  __Pyx_TraceLine(906,1,__PYX_ERR(2, 906, __pyx_L1_error))
15249  __pyx_r = 0;
15250  goto __pyx_L0;
15251 
15252  /* "View.MemoryView":809
15253  *
15254  * @cname('__pyx_memoryview_slice_memviewslice')
15255  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
15256  * __Pyx_memviewslice *dst,
15257  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
15258  */
15259 
15260  /* function exit code */
15261  __pyx_L1_error:;
15262  {
15263  #ifdef WITH_THREAD
15264  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
15265  #endif
15266  __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15267  #ifdef WITH_THREAD
15268  __Pyx_PyGILState_Release(__pyx_gilstate_save);
15269  #endif
15270  }
15271  __pyx_r = -1;
15272  __pyx_L0:;
15273  __Pyx_TraceReturn(Py_None, 1);
15274  return __pyx_r;
15275 }
15276 
15277 /* "View.MemoryView":912
15278  *
15279  * @cname('__pyx_pybuffer_index')
15280  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
15281  * Py_ssize_t dim) except NULL:
15282  * cdef Py_ssize_t shape, stride, suboffset = -1
15283  */
15284 
15285 static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
15286  Py_ssize_t __pyx_v_shape;
15287  Py_ssize_t __pyx_v_stride;
15288  Py_ssize_t __pyx_v_suboffset;
15289  Py_ssize_t __pyx_v_itemsize;
15290  char *__pyx_v_resultp;
15291  char *__pyx_r;
15292  __Pyx_TraceDeclarations
15293  __Pyx_RefNannyDeclarations
15294  Py_ssize_t __pyx_t_1;
15295  int __pyx_t_2;
15296  PyObject *__pyx_t_3 = NULL;
15297  PyObject *__pyx_t_4 = NULL;
15298  int __pyx_lineno = 0;
15299  const char *__pyx_filename = NULL;
15300  int __pyx_clineno = 0;
15301  __Pyx_RefNannySetupContext("pybuffer_index", 0);
15302  __Pyx_TraceCall("pybuffer_index", __pyx_f[2], 912, 0, __PYX_ERR(2, 912, __pyx_L1_error));
15303 
15304  /* "View.MemoryView":914
15305  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
15306  * Py_ssize_t dim) except NULL:
15307  * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<<
15308  * cdef Py_ssize_t itemsize = view.itemsize
15309  * cdef char *resultp
15310  */
15311  __Pyx_TraceLine(914,0,__PYX_ERR(2, 914, __pyx_L1_error))
15312  __pyx_v_suboffset = -1L;
15313 
15314  /* "View.MemoryView":915
15315  * Py_ssize_t dim) except NULL:
15316  * cdef Py_ssize_t shape, stride, suboffset = -1
15317  * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<<
15318  * cdef char *resultp
15319  *
15320  */
15321  __Pyx_TraceLine(915,0,__PYX_ERR(2, 915, __pyx_L1_error))
15322  __pyx_t_1 = __pyx_v_view->itemsize;
15323  __pyx_v_itemsize = __pyx_t_1;
15324 
15325  /* "View.MemoryView":918
15326  * cdef char *resultp
15327  *
15328  * if view.ndim == 0: # <<<<<<<<<<<<<<
15329  * shape = view.len / itemsize
15330  * stride = itemsize
15331  */
15332  __Pyx_TraceLine(918,0,__PYX_ERR(2, 918, __pyx_L1_error))
15333  __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
15334  if (__pyx_t_2) {
15335 
15336  /* "View.MemoryView":919
15337  *
15338  * if view.ndim == 0:
15339  * shape = view.len / itemsize # <<<<<<<<<<<<<<
15340  * stride = itemsize
15341  * else:
15342  */
15343  __Pyx_TraceLine(919,0,__PYX_ERR(2, 919, __pyx_L1_error))
15344  if (unlikely(__pyx_v_itemsize == 0)) {
15345  PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
15346  __PYX_ERR(2, 919, __pyx_L1_error)
15347  }
15348  else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
15349  PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
15350  __PYX_ERR(2, 919, __pyx_L1_error)
15351  }
15352  __pyx_v_shape = (__pyx_v_view->len / __pyx_v_itemsize);
15353 
15354  /* "View.MemoryView":920
15355  * if view.ndim == 0:
15356  * shape = view.len / itemsize
15357  * stride = itemsize # <<<<<<<<<<<<<<
15358  * else:
15359  * shape = view.shape[dim]
15360  */
15361  __Pyx_TraceLine(920,0,__PYX_ERR(2, 920, __pyx_L1_error))
15362  __pyx_v_stride = __pyx_v_itemsize;
15363 
15364  /* "View.MemoryView":918
15365  * cdef char *resultp
15366  *
15367  * if view.ndim == 0: # <<<<<<<<<<<<<<
15368  * shape = view.len / itemsize
15369  * stride = itemsize
15370  */
15371  goto __pyx_L3;
15372  }
15373 
15374  /* "View.MemoryView":922
15375  * stride = itemsize
15376  * else:
15377  * shape = view.shape[dim] # <<<<<<<<<<<<<<
15378  * stride = view.strides[dim]
15379  * if view.suboffsets != NULL:
15380  */
15381  __Pyx_TraceLine(922,0,__PYX_ERR(2, 922, __pyx_L1_error))
15382  /*else*/ {
15383  __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
15384 
15385  /* "View.MemoryView":923
15386  * else:
15387  * shape = view.shape[dim]
15388  * stride = view.strides[dim] # <<<<<<<<<<<<<<
15389  * if view.suboffsets != NULL:
15390  * suboffset = view.suboffsets[dim]
15391  */
15392  __Pyx_TraceLine(923,0,__PYX_ERR(2, 923, __pyx_L1_error))
15393  __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
15394 
15395  /* "View.MemoryView":924
15396  * shape = view.shape[dim]
15397  * stride = view.strides[dim]
15398  * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
15399  * suboffset = view.suboffsets[dim]
15400  *
15401  */
15402  __Pyx_TraceLine(924,0,__PYX_ERR(2, 924, __pyx_L1_error))
15403  __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
15404  if (__pyx_t_2) {
15405 
15406  /* "View.MemoryView":925
15407  * stride = view.strides[dim]
15408  * if view.suboffsets != NULL:
15409  * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<<
15410  *
15411  * if index < 0:
15412  */
15413  __Pyx_TraceLine(925,0,__PYX_ERR(2, 925, __pyx_L1_error))
15414  __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
15415 
15416  /* "View.MemoryView":924
15417  * shape = view.shape[dim]
15418  * stride = view.strides[dim]
15419  * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
15420  * suboffset = view.suboffsets[dim]
15421  *
15422  */
15423  }
15424  }
15425  __pyx_L3:;
15426 
15427  /* "View.MemoryView":927
15428  * suboffset = view.suboffsets[dim]
15429  *
15430  * if index < 0: # <<<<<<<<<<<<<<
15431  * index += view.shape[dim]
15432  * if index < 0:
15433  */
15434  __Pyx_TraceLine(927,0,__PYX_ERR(2, 927, __pyx_L1_error))
15435  __pyx_t_2 = ((__pyx_v_index < 0) != 0);
15436  if (__pyx_t_2) {
15437 
15438  /* "View.MemoryView":928
15439  *
15440  * if index < 0:
15441  * index += view.shape[dim] # <<<<<<<<<<<<<<
15442  * if index < 0:
15443  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
15444  */
15445  __Pyx_TraceLine(928,0,__PYX_ERR(2, 928, __pyx_L1_error))
15446  __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
15447 
15448  /* "View.MemoryView":929
15449  * if index < 0:
15450  * index += view.shape[dim]
15451  * if index < 0: # <<<<<<<<<<<<<<
15452  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
15453  *
15454  */
15455  __Pyx_TraceLine(929,0,__PYX_ERR(2, 929, __pyx_L1_error))
15456  __pyx_t_2 = ((__pyx_v_index < 0) != 0);
15457  if (unlikely(__pyx_t_2)) {
15458 
15459  /* "View.MemoryView":930
15460  * index += view.shape[dim]
15461  * if index < 0:
15462  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
15463  *
15464  * if index >= shape:
15465  */
15466  __Pyx_TraceLine(930,0,__PYX_ERR(2, 930, __pyx_L1_error))
15467  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 930, __pyx_L1_error)
15468  __Pyx_GOTREF(__pyx_t_3);
15469  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 930, __pyx_L1_error)
15470  __Pyx_GOTREF(__pyx_t_4);
15471  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15472  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 930, __pyx_L1_error)
15473  __Pyx_GOTREF(__pyx_t_3);
15474  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15475  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
15476  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15477  __PYX_ERR(2, 930, __pyx_L1_error)
15478 
15479  /* "View.MemoryView":929
15480  * if index < 0:
15481  * index += view.shape[dim]
15482  * if index < 0: # <<<<<<<<<<<<<<
15483  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
15484  *
15485  */
15486  }
15487 
15488  /* "View.MemoryView":927
15489  * suboffset = view.suboffsets[dim]
15490  *
15491  * if index < 0: # <<<<<<<<<<<<<<
15492  * index += view.shape[dim]
15493  * if index < 0:
15494  */
15495  }
15496 
15497  /* "View.MemoryView":932
15498  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
15499  *
15500  * if index >= shape: # <<<<<<<<<<<<<<
15501  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
15502  *
15503  */
15504  __Pyx_TraceLine(932,0,__PYX_ERR(2, 932, __pyx_L1_error))
15505  __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
15506  if (unlikely(__pyx_t_2)) {
15507 
15508  /* "View.MemoryView":933
15509  *
15510  * if index >= shape:
15511  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
15512  *
15513  * resultp = bufp + index * stride
15514  */
15515  __Pyx_TraceLine(933,0,__PYX_ERR(2, 933, __pyx_L1_error))
15516  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 933, __pyx_L1_error)
15517  __Pyx_GOTREF(__pyx_t_3);
15518  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 933, __pyx_L1_error)
15519  __Pyx_GOTREF(__pyx_t_4);
15520  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15521  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 933, __pyx_L1_error)
15522  __Pyx_GOTREF(__pyx_t_3);
15523  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15524  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
15525  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15526  __PYX_ERR(2, 933, __pyx_L1_error)
15527 
15528  /* "View.MemoryView":932
15529  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
15530  *
15531  * if index >= shape: # <<<<<<<<<<<<<<
15532  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
15533  *
15534  */
15535  }
15536 
15537  /* "View.MemoryView":935
15538  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
15539  *
15540  * resultp = bufp + index * stride # <<<<<<<<<<<<<<
15541  * if suboffset >= 0:
15542  * resultp = (<char **> resultp)[0] + suboffset
15543  */
15544  __Pyx_TraceLine(935,0,__PYX_ERR(2, 935, __pyx_L1_error))
15545  __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
15546 
15547  /* "View.MemoryView":936
15548  *
15549  * resultp = bufp + index * stride
15550  * if suboffset >= 0: # <<<<<<<<<<<<<<
15551  * resultp = (<char **> resultp)[0] + suboffset
15552  *
15553  */
15554  __Pyx_TraceLine(936,0,__PYX_ERR(2, 936, __pyx_L1_error))
15555  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
15556  if (__pyx_t_2) {
15557 
15558  /* "View.MemoryView":937
15559  * resultp = bufp + index * stride
15560  * if suboffset >= 0:
15561  * resultp = (<char **> resultp)[0] + suboffset # <<<<<<<<<<<<<<
15562  *
15563  * return resultp
15564  */
15565  __Pyx_TraceLine(937,0,__PYX_ERR(2, 937, __pyx_L1_error))
15566  __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
15567 
15568  /* "View.MemoryView":936
15569  *
15570  * resultp = bufp + index * stride
15571  * if suboffset >= 0: # <<<<<<<<<<<<<<
15572  * resultp = (<char **> resultp)[0] + suboffset
15573  *
15574  */
15575  }
15576 
15577  /* "View.MemoryView":939
15578  * resultp = (<char **> resultp)[0] + suboffset
15579  *
15580  * return resultp # <<<<<<<<<<<<<<
15581  *
15582  *
15583  */
15584  __Pyx_TraceLine(939,0,__PYX_ERR(2, 939, __pyx_L1_error))
15585  __pyx_r = __pyx_v_resultp;
15586  goto __pyx_L0;
15587 
15588  /* "View.MemoryView":912
15589  *
15590  * @cname('__pyx_pybuffer_index')
15591  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
15592  * Py_ssize_t dim) except NULL:
15593  * cdef Py_ssize_t shape, stride, suboffset = -1
15594  */
15595 
15596  /* function exit code */
15597  __pyx_L1_error:;
15598  __Pyx_XDECREF(__pyx_t_3);
15599  __Pyx_XDECREF(__pyx_t_4);
15600  __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
15601  __pyx_r = NULL;
15602  __pyx_L0:;
15603  __Pyx_TraceReturn(Py_None, 0);
15604  __Pyx_RefNannyFinishContext();
15605  return __pyx_r;
15606 }
15607 
15608 /* "View.MemoryView":945
15609  *
15610  * @cname('__pyx_memslice_transpose')
15611  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
15612  * cdef int ndim = memslice.memview.view.ndim
15613  *
15614  */
15615 
15616 static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
15617  int __pyx_v_ndim;
15618  Py_ssize_t *__pyx_v_shape;
15619  Py_ssize_t *__pyx_v_strides;
15620  int __pyx_v_i;
15621  int __pyx_v_j;
15622  int __pyx_r;
15623  __Pyx_TraceDeclarations
15624  int __pyx_t_1;
15625  Py_ssize_t *__pyx_t_2;
15626  long __pyx_t_3;
15627  long __pyx_t_4;
15628  Py_ssize_t __pyx_t_5;
15629  Py_ssize_t __pyx_t_6;
15630  int __pyx_t_7;
15631  int __pyx_t_8;
15632  int __pyx_t_9;
15633  int __pyx_lineno = 0;
15634  const char *__pyx_filename = NULL;
15635  int __pyx_clineno = 0;
15636  __Pyx_TraceCall("transpose_memslice", __pyx_f[2], 945, 1, __PYX_ERR(2, 945, __pyx_L1_error));
15637 
15638  /* "View.MemoryView":946
15639  * @cname('__pyx_memslice_transpose')
15640  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:
15641  * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<<
15642  *
15643  * cdef Py_ssize_t *shape = memslice.shape
15644  */
15645  __Pyx_TraceLine(946,1,__PYX_ERR(2, 946, __pyx_L1_error))
15646  __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
15647  __pyx_v_ndim = __pyx_t_1;
15648 
15649  /* "View.MemoryView":948
15650  * cdef int ndim = memslice.memview.view.ndim
15651  *
15652  * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<<
15653  * cdef Py_ssize_t *strides = memslice.strides
15654  *
15655  */
15656  __Pyx_TraceLine(948,1,__PYX_ERR(2, 948, __pyx_L1_error))
15657  __pyx_t_2 = __pyx_v_memslice->shape;
15658  __pyx_v_shape = __pyx_t_2;
15659 
15660  /* "View.MemoryView":949
15661  *
15662  * cdef Py_ssize_t *shape = memslice.shape
15663  * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<<
15664  *
15665  *
15666  */
15667  __Pyx_TraceLine(949,1,__PYX_ERR(2, 949, __pyx_L1_error))
15668  __pyx_t_2 = __pyx_v_memslice->strides;
15669  __pyx_v_strides = __pyx_t_2;
15670 
15671  /* "View.MemoryView":953
15672  *
15673  * cdef int i, j
15674  * for i in range(ndim / 2): # <<<<<<<<<<<<<<
15675  * j = ndim - 1 - i
15676  * strides[i], strides[j] = strides[j], strides[i]
15677  */
15678  __Pyx_TraceLine(953,1,__PYX_ERR(2, 953, __pyx_L1_error))
15679  __pyx_t_3 = (__pyx_v_ndim / 2);
15680  __pyx_t_4 = __pyx_t_3;
15681  for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
15682  __pyx_v_i = __pyx_t_1;
15683 
15684  /* "View.MemoryView":954
15685  * cdef int i, j
15686  * for i in range(ndim / 2):
15687  * j = ndim - 1 - i # <<<<<<<<<<<<<<
15688  * strides[i], strides[j] = strides[j], strides[i]
15689  * shape[i], shape[j] = shape[j], shape[i]
15690  */
15691  __Pyx_TraceLine(954,1,__PYX_ERR(2, 954, __pyx_L1_error))
15692  __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
15693 
15694  /* "View.MemoryView":955
15695  * for i in range(ndim / 2):
15696  * j = ndim - 1 - i
15697  * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<<
15698  * shape[i], shape[j] = shape[j], shape[i]
15699  *
15700  */
15701  __Pyx_TraceLine(955,1,__PYX_ERR(2, 955, __pyx_L1_error))
15702  __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
15703  __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
15704  (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
15705  (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
15706 
15707  /* "View.MemoryView":956
15708  * j = ndim - 1 - i
15709  * strides[i], strides[j] = strides[j], strides[i]
15710  * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<<
15711  *
15712  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
15713  */
15714  __Pyx_TraceLine(956,1,__PYX_ERR(2, 956, __pyx_L1_error))
15715  __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
15716  __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
15717  (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
15718  (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
15719 
15720  /* "View.MemoryView":958
15721  * shape[i], shape[j] = shape[j], shape[i]
15722  *
15723  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
15724  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
15725  *
15726  */
15727  __Pyx_TraceLine(958,1,__PYX_ERR(2, 958, __pyx_L1_error))
15728  __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
15729  if (!__pyx_t_8) {
15730  } else {
15731  __pyx_t_7 = __pyx_t_8;
15732  goto __pyx_L6_bool_binop_done;
15733  }
15734  __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
15735  __pyx_t_7 = __pyx_t_8;
15736  __pyx_L6_bool_binop_done:;
15737  if (__pyx_t_7) {
15738 
15739  /* "View.MemoryView":959
15740  *
15741  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
15742  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<<
15743  *
15744  * return 1
15745  */
15746  __Pyx_TraceLine(959,1,__PYX_ERR(2, 959, __pyx_L1_error))
15747  __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 959, __pyx_L1_error)
15748 
15749  /* "View.MemoryView":958
15750  * shape[i], shape[j] = shape[j], shape[i]
15751  *
15752  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
15753  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
15754  *
15755  */
15756  }
15757  }
15758 
15759  /* "View.MemoryView":961
15760  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
15761  *
15762  * return 1 # <<<<<<<<<<<<<<
15763  *
15764  *
15765  */
15766  __Pyx_TraceLine(961,1,__PYX_ERR(2, 961, __pyx_L1_error))
15767  __pyx_r = 1;
15768  goto __pyx_L0;
15769 
15770  /* "View.MemoryView":945
15771  *
15772  * @cname('__pyx_memslice_transpose')
15773  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
15774  * cdef int ndim = memslice.memview.view.ndim
15775  *
15776  */
15777 
15778  /* function exit code */
15779  __pyx_L1_error:;
15780  {
15781  #ifdef WITH_THREAD
15782  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
15783  #endif
15784  __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15785  #ifdef WITH_THREAD
15786  __Pyx_PyGILState_Release(__pyx_gilstate_save);
15787  #endif
15788  }
15789  __pyx_r = 0;
15790  __pyx_L0:;
15791  __Pyx_TraceReturn(Py_None, 1);
15792  return __pyx_r;
15793 }
15794 
15795 /* "View.MemoryView":978
15796  * cdef int (*to_dtype_func)(char *, object) except 0
15797  *
15798  * def __dealloc__(self): # <<<<<<<<<<<<<<
15799  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
15800  *
15801  */
15802 
15803 /* Python wrapper */
15804 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
15805 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
15806  __Pyx_RefNannyDeclarations
15807  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
15808  __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
15809 
15810  /* function exit code */
15811  __Pyx_RefNannyFinishContext();
15812 }
15813 
15814 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
15815  __Pyx_TraceDeclarations
15816  __Pyx_RefNannyDeclarations
15817  int __pyx_lineno = 0;
15818  const char *__pyx_filename = NULL;
15819  int __pyx_clineno = 0;
15820  __Pyx_RefNannySetupContext("__dealloc__", 0);
15821  __Pyx_TraceCall("__dealloc__", __pyx_f[2], 978, 0, __PYX_ERR(2, 978, __pyx_L1_error));
15822 
15823  /* "View.MemoryView":979
15824  *
15825  * def __dealloc__(self):
15826  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<<
15827  *
15828  * cdef convert_item_to_object(self, char *itemp):
15829  */
15830  __Pyx_TraceLine(979,0,__PYX_ERR(2, 979, __pyx_L1_error))
15831  __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
15832 
15833  /* "View.MemoryView":978
15834  * cdef int (*to_dtype_func)(char *, object) except 0
15835  *
15836  * def __dealloc__(self): # <<<<<<<<<<<<<<
15837  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
15838  *
15839  */
15840 
15841  /* function exit code */
15842  goto __pyx_L0;
15843  __pyx_L1_error:;
15844  __Pyx_WriteUnraisable("View.MemoryView._memoryviewslice.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
15845  __pyx_L0:;
15846  __Pyx_TraceReturn(Py_None, 0);
15847  __Pyx_RefNannyFinishContext();
15848 }
15849 
15850 /* "View.MemoryView":981
15851  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
15852  *
15853  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
15854  * if self.to_object_func != NULL:
15855  * return self.to_object_func(itemp)
15856  */
15857 
15858 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
15859  PyObject *__pyx_r = NULL;
15860  __Pyx_TraceDeclarations
15861  __Pyx_RefNannyDeclarations
15862  int __pyx_t_1;
15863  PyObject *__pyx_t_2 = NULL;
15864  int __pyx_lineno = 0;
15865  const char *__pyx_filename = NULL;
15866  int __pyx_clineno = 0;
15867  __Pyx_RefNannySetupContext("convert_item_to_object", 0);
15868  __Pyx_TraceCall("convert_item_to_object", __pyx_f[2], 981, 0, __PYX_ERR(2, 981, __pyx_L1_error));
15869 
15870  /* "View.MemoryView":982
15871  *
15872  * cdef convert_item_to_object(self, char *itemp):
15873  * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
15874  * return self.to_object_func(itemp)
15875  * else:
15876  */
15877  __Pyx_TraceLine(982,0,__PYX_ERR(2, 982, __pyx_L1_error))
15878  __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
15879  if (__pyx_t_1) {
15880 
15881  /* "View.MemoryView":983
15882  * cdef convert_item_to_object(self, char *itemp):
15883  * if self.to_object_func != NULL:
15884  * return self.to_object_func(itemp) # <<<<<<<<<<<<<<
15885  * else:
15886  * return memoryview.convert_item_to_object(self, itemp)
15887  */
15888  __Pyx_TraceLine(983,0,__PYX_ERR(2, 983, __pyx_L1_error))
15889  __Pyx_XDECREF(__pyx_r);
15890  __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 983, __pyx_L1_error)
15891  __Pyx_GOTREF(__pyx_t_2);
15892  __pyx_r = __pyx_t_2;
15893  __pyx_t_2 = 0;
15894  goto __pyx_L0;
15895 
15896  /* "View.MemoryView":982
15897  *
15898  * cdef convert_item_to_object(self, char *itemp):
15899  * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
15900  * return self.to_object_func(itemp)
15901  * else:
15902  */
15903  }
15904 
15905  /* "View.MemoryView":985
15906  * return self.to_object_func(itemp)
15907  * else:
15908  * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<<
15909  *
15910  * cdef assign_item_from_object(self, char *itemp, object value):
15911  */
15912  __Pyx_TraceLine(985,0,__PYX_ERR(2, 985, __pyx_L1_error))
15913  /*else*/ {
15914  __Pyx_XDECREF(__pyx_r);
15915  __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 985, __pyx_L1_error)
15916  __Pyx_GOTREF(__pyx_t_2);
15917  __pyx_r = __pyx_t_2;
15918  __pyx_t_2 = 0;
15919  goto __pyx_L0;
15920  }
15921 
15922  /* "View.MemoryView":981
15923  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
15924  *
15925  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
15926  * if self.to_object_func != NULL:
15927  * return self.to_object_func(itemp)
15928  */
15929 
15930  /* function exit code */
15931  __pyx_L1_error:;
15932  __Pyx_XDECREF(__pyx_t_2);
15933  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
15934  __pyx_r = 0;
15935  __pyx_L0:;
15936  __Pyx_XGIVEREF(__pyx_r);
15937  __Pyx_TraceReturn(__pyx_r, 0);
15938  __Pyx_RefNannyFinishContext();
15939  return __pyx_r;
15940 }
15941 
15942 /* "View.MemoryView":987
15943  * return memoryview.convert_item_to_object(self, itemp)
15944  *
15945  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
15946  * if self.to_dtype_func != NULL:
15947  * self.to_dtype_func(itemp, value)
15948  */
15949 
15950 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
15951  PyObject *__pyx_r = NULL;
15952  __Pyx_TraceDeclarations
15953  __Pyx_RefNannyDeclarations
15954  int __pyx_t_1;
15955  int __pyx_t_2;
15956  PyObject *__pyx_t_3 = NULL;
15957  int __pyx_lineno = 0;
15958  const char *__pyx_filename = NULL;
15959  int __pyx_clineno = 0;
15960  __Pyx_RefNannySetupContext("assign_item_from_object", 0);
15961  __Pyx_TraceCall("assign_item_from_object", __pyx_f[2], 987, 0, __PYX_ERR(2, 987, __pyx_L1_error));
15962 
15963  /* "View.MemoryView":988
15964  *
15965  * cdef assign_item_from_object(self, char *itemp, object value):
15966  * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
15967  * self.to_dtype_func(itemp, value)
15968  * else:
15969  */
15970  __Pyx_TraceLine(988,0,__PYX_ERR(2, 988, __pyx_L1_error))
15971  __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
15972  if (__pyx_t_1) {
15973 
15974  /* "View.MemoryView":989
15975  * cdef assign_item_from_object(self, char *itemp, object value):
15976  * if self.to_dtype_func != NULL:
15977  * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<<
15978  * else:
15979  * memoryview.assign_item_from_object(self, itemp, value)
15980  */
15981  __Pyx_TraceLine(989,0,__PYX_ERR(2, 989, __pyx_L1_error))
15982  __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(2, 989, __pyx_L1_error)
15983 
15984  /* "View.MemoryView":988
15985  *
15986  * cdef assign_item_from_object(self, char *itemp, object value):
15987  * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
15988  * self.to_dtype_func(itemp, value)
15989  * else:
15990  */
15991  goto __pyx_L3;
15992  }
15993 
15994  /* "View.MemoryView":991
15995  * self.to_dtype_func(itemp, value)
15996  * else:
15997  * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<<
15998  *
15999  * @property
16000  */
16001  __Pyx_TraceLine(991,0,__PYX_ERR(2, 991, __pyx_L1_error))
16002  /*else*/ {
16003  __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 991, __pyx_L1_error)
16004  __Pyx_GOTREF(__pyx_t_3);
16005  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16006  }
16007  __pyx_L3:;
16008 
16009  /* "View.MemoryView":987
16010  * return memoryview.convert_item_to_object(self, itemp)
16011  *
16012  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
16013  * if self.to_dtype_func != NULL:
16014  * self.to_dtype_func(itemp, value)
16015  */
16016 
16017  /* function exit code */
16018  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16019  goto __pyx_L0;
16020  __pyx_L1_error:;
16021  __Pyx_XDECREF(__pyx_t_3);
16022  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
16023  __pyx_r = 0;
16024  __pyx_L0:;
16025  __Pyx_XGIVEREF(__pyx_r);
16026  __Pyx_TraceReturn(__pyx_r, 0);
16027  __Pyx_RefNannyFinishContext();
16028  return __pyx_r;
16029 }
16030 
16031 /* "View.MemoryView":994
16032  *
16033  * @property
16034  * def base(self): # <<<<<<<<<<<<<<
16035  * return self.from_object
16036  *
16037  */
16038 
16039 /* Python wrapper */
16040 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
16041 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
16042  PyObject *__pyx_r = 0;
16043  __Pyx_RefNannyDeclarations
16044  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
16045  __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
16046 
16047  /* function exit code */
16048  __Pyx_RefNannyFinishContext();
16049  return __pyx_r;
16050 }
16051 
16052 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
16053  PyObject *__pyx_r = NULL;
16054  __Pyx_TraceDeclarations
16055  __Pyx_RefNannyDeclarations
16056  int __pyx_lineno = 0;
16057  const char *__pyx_filename = NULL;
16058  int __pyx_clineno = 0;
16059  __Pyx_RefNannySetupContext("__get__", 0);
16060  __Pyx_TraceCall("__get__", __pyx_f[2], 994, 0, __PYX_ERR(2, 994, __pyx_L1_error));
16061 
16062  /* "View.MemoryView":995
16063  * @property
16064  * def base(self):
16065  * return self.from_object # <<<<<<<<<<<<<<
16066  *
16067  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
16068  */
16069  __Pyx_TraceLine(995,0,__PYX_ERR(2, 995, __pyx_L1_error))
16070  __Pyx_XDECREF(__pyx_r);
16071  __Pyx_INCREF(__pyx_v_self->from_object);
16072  __pyx_r = __pyx_v_self->from_object;
16073  goto __pyx_L0;
16074 
16075  /* "View.MemoryView":994
16076  *
16077  * @property
16078  * def base(self): # <<<<<<<<<<<<<<
16079  * return self.from_object
16080  *
16081  */
16082 
16083  /* function exit code */
16084  __pyx_L1_error:;
16085  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16086  __pyx_r = NULL;
16087  __pyx_L0:;
16088  __Pyx_XGIVEREF(__pyx_r);
16089  __Pyx_TraceReturn(__pyx_r, 0);
16090  __Pyx_RefNannyFinishContext();
16091  return __pyx_r;
16092 }
16093 
16094 /* "(tree fragment)":1
16095  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
16096  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
16097  * def __setstate_cython__(self, __pyx_state):
16098  */
16099 
16100 /* Python wrapper */
16101 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
16102 static PyMethodDef __pyx_mdef___pyx_memoryviewslice_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0};
16103 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
16104  PyObject *__pyx_r = 0;
16105  __Pyx_RefNannyDeclarations
16106  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
16107  __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
16108 
16109  /* function exit code */
16110  __Pyx_RefNannyFinishContext();
16111  return __pyx_r;
16112 }
16113 
16114 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) {
16115  PyObject *__pyx_r = NULL;
16116  __Pyx_TraceDeclarations
16117  __Pyx_RefNannyDeclarations
16118  PyObject *__pyx_t_1 = NULL;
16119  int __pyx_lineno = 0;
16120  const char *__pyx_filename = NULL;
16121  int __pyx_clineno = 0;
16122  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
16123  __Pyx_TraceCall("__reduce_cython__", __pyx_f[2], 1, 0, __PYX_ERR(2, 1, __pyx_L1_error));
16124 
16125  /* "(tree fragment)":2
16126  * def __reduce_cython__(self):
16127  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
16128  * def __setstate_cython__(self, __pyx_state):
16129  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
16130  */
16131  __Pyx_TraceLine(2,0,__PYX_ERR(2, 2, __pyx_L1_error))
16132  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2, __pyx_L1_error)
16133  __Pyx_GOTREF(__pyx_t_1);
16134  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
16135  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16136  __PYX_ERR(2, 2, __pyx_L1_error)
16137 
16138  /* "(tree fragment)":1
16139  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
16140  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
16141  * def __setstate_cython__(self, __pyx_state):
16142  */
16143 
16144  /* function exit code */
16145  __pyx_L1_error:;
16146  __Pyx_XDECREF(__pyx_t_1);
16147  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16148  __pyx_r = NULL;
16149  __Pyx_XGIVEREF(__pyx_r);
16150  __Pyx_TraceReturn(__pyx_r, 0);
16151  __Pyx_RefNannyFinishContext();
16152  return __pyx_r;
16153 }
16154 
16155 /* "(tree fragment)":3
16156  * def __reduce_cython__(self):
16157  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
16158  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
16159  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
16160  */
16161 
16162 /* Python wrapper */
16163 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
16164 static PyMethodDef __pyx_mdef___pyx_memoryviewslice_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0};
16165 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
16166  PyObject *__pyx_r = 0;
16167  __Pyx_RefNannyDeclarations
16168  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
16169  __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
16170 
16171  /* function exit code */
16172  __Pyx_RefNannyFinishContext();
16173  return __pyx_r;
16174 }
16175 
16176 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
16177  PyObject *__pyx_r = NULL;
16178  __Pyx_TraceDeclarations
16179  __Pyx_RefNannyDeclarations
16180  PyObject *__pyx_t_1 = NULL;
16181  int __pyx_lineno = 0;
16182  const char *__pyx_filename = NULL;
16183  int __pyx_clineno = 0;
16184  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
16185  __Pyx_TraceCall("__setstate_cython__", __pyx_f[2], 3, 0, __PYX_ERR(2, 3, __pyx_L1_error));
16186 
16187  /* "(tree fragment)":4
16188  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
16189  * def __setstate_cython__(self, __pyx_state):
16190  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
16191  */
16192  __Pyx_TraceLine(4,0,__PYX_ERR(2, 4, __pyx_L1_error))
16193  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error)
16194  __Pyx_GOTREF(__pyx_t_1);
16195  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
16196  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16197  __PYX_ERR(2, 4, __pyx_L1_error)
16198 
16199  /* "(tree fragment)":3
16200  * def __reduce_cython__(self):
16201  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
16202  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
16203  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
16204  */
16205 
16206  /* function exit code */
16207  __pyx_L1_error:;
16208  __Pyx_XDECREF(__pyx_t_1);
16209  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16210  __pyx_r = NULL;
16211  __Pyx_XGIVEREF(__pyx_r);
16212  __Pyx_TraceReturn(__pyx_r, 0);
16213  __Pyx_RefNannyFinishContext();
16214  return __pyx_r;
16215 }
16216 
16217 /* "View.MemoryView":1001
16218  *
16219  * @cname('__pyx_memoryview_fromslice')
16220  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
16221  * int ndim,
16222  * object (*to_object_func)(char *),
16223  */
16224 
16225 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), int (*__pyx_v_to_dtype_func)(char *, PyObject *), int __pyx_v_dtype_is_object) {
16226  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
16227  Py_ssize_t __pyx_v_suboffset;
16228  PyObject *__pyx_v_length = NULL;
16229  PyObject *__pyx_r = NULL;
16230  __Pyx_TraceDeclarations
16231  __Pyx_RefNannyDeclarations
16232  int __pyx_t_1;
16233  PyObject *__pyx_t_2 = NULL;
16234  PyObject *__pyx_t_3 = NULL;
16235  __Pyx_TypeInfo *__pyx_t_4;
16236  Py_buffer __pyx_t_5;
16237  Py_ssize_t *__pyx_t_6;
16238  Py_ssize_t *__pyx_t_7;
16239  Py_ssize_t *__pyx_t_8;
16240  Py_ssize_t __pyx_t_9;
16241  int __pyx_lineno = 0;
16242  const char *__pyx_filename = NULL;
16243  int __pyx_clineno = 0;
16244  __Pyx_RefNannySetupContext("memoryview_fromslice", 0);
16245  __Pyx_TraceCall("memoryview_fromslice", __pyx_f[2], 1001, 0, __PYX_ERR(2, 1001, __pyx_L1_error));
16246 
16247  /* "View.MemoryView":1009
16248  * cdef _memoryviewslice result
16249  *
16250  * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
16251  * return None
16252  *
16253  */
16254  __Pyx_TraceLine(1009,0,__PYX_ERR(2, 1009, __pyx_L1_error))
16255  __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
16256  if (__pyx_t_1) {
16257 
16258  /* "View.MemoryView":1010
16259  *
16260  * if <PyObject *> memviewslice.memview == Py_None:
16261  * return None # <<<<<<<<<<<<<<
16262  *
16263  *
16264  */
16265  __Pyx_TraceLine(1010,0,__PYX_ERR(2, 1010, __pyx_L1_error))
16266  __Pyx_XDECREF(__pyx_r);
16267  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16268  goto __pyx_L0;
16269 
16270  /* "View.MemoryView":1009
16271  * cdef _memoryviewslice result
16272  *
16273  * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
16274  * return None
16275  *
16276  */
16277  }
16278 
16279  /* "View.MemoryView":1015
16280  *
16281  *
16282  * result = _memoryviewslice(None, 0, dtype_is_object) # <<<<<<<<<<<<<<
16283  *
16284  * result.from_slice = memviewslice
16285  */
16286  __Pyx_TraceLine(1015,0,__PYX_ERR(2, 1015, __pyx_L1_error))
16287  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1015, __pyx_L1_error)
16288  __Pyx_GOTREF(__pyx_t_2);
16289  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1015, __pyx_L1_error)
16290  __Pyx_GOTREF(__pyx_t_3);
16291  __Pyx_INCREF(Py_None);
16292  __Pyx_GIVEREF(Py_None);
16293  PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
16294  __Pyx_INCREF(__pyx_int_0);
16295  __Pyx_GIVEREF(__pyx_int_0);
16296  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
16297  __Pyx_GIVEREF(__pyx_t_2);
16298  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
16299  __pyx_t_2 = 0;
16300  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1015, __pyx_L1_error)
16301  __Pyx_GOTREF(__pyx_t_2);
16302  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16303  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
16304  __pyx_t_2 = 0;
16305 
16306  /* "View.MemoryView":1017
16307  * result = _memoryviewslice(None, 0, dtype_is_object)
16308  *
16309  * result.from_slice = memviewslice # <<<<<<<<<<<<<<
16310  * __PYX_INC_MEMVIEW(&memviewslice, 1)
16311  *
16312  */
16313  __Pyx_TraceLine(1017,0,__PYX_ERR(2, 1017, __pyx_L1_error))
16314  __pyx_v_result->from_slice = __pyx_v_memviewslice;
16315 
16316  /* "View.MemoryView":1018
16317  *
16318  * result.from_slice = memviewslice
16319  * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<<
16320  *
16321  * result.from_object = (<memoryview> memviewslice.memview).base
16322  */
16323  __Pyx_TraceLine(1018,0,__PYX_ERR(2, 1018, __pyx_L1_error))
16324  __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
16325 
16326  /* "View.MemoryView":1020
16327  * __PYX_INC_MEMVIEW(&memviewslice, 1)
16328  *
16329  * result.from_object = (<memoryview> memviewslice.memview).base # <<<<<<<<<<<<<<
16330  * result.typeinfo = memviewslice.memview.typeinfo
16331  *
16332  */
16333  __Pyx_TraceLine(1020,0,__PYX_ERR(2, 1020, __pyx_L1_error))
16334  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1020, __pyx_L1_error)
16335  __Pyx_GOTREF(__pyx_t_2);
16336  __Pyx_GIVEREF(__pyx_t_2);
16337  __Pyx_GOTREF(__pyx_v_result->from_object);
16338  __Pyx_DECREF(__pyx_v_result->from_object);
16339  __pyx_v_result->from_object = __pyx_t_2;
16340  __pyx_t_2 = 0;
16341 
16342  /* "View.MemoryView":1021
16343  *
16344  * result.from_object = (<memoryview> memviewslice.memview).base
16345  * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<<
16346  *
16347  * result.view = memviewslice.memview.view
16348  */
16349  __Pyx_TraceLine(1021,0,__PYX_ERR(2, 1021, __pyx_L1_error))
16350  __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
16351  __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
16352 
16353  /* "View.MemoryView":1023
16354  * result.typeinfo = memviewslice.memview.typeinfo
16355  *
16356  * result.view = memviewslice.memview.view # <<<<<<<<<<<<<<
16357  * result.view.buf = <void *> memviewslice.data
16358  * result.view.ndim = ndim
16359  */
16360  __Pyx_TraceLine(1023,0,__PYX_ERR(2, 1023, __pyx_L1_error))
16361  __pyx_t_5 = __pyx_v_memviewslice.memview->view;
16362  __pyx_v_result->__pyx_base.view = __pyx_t_5;
16363 
16364  /* "View.MemoryView":1024
16365  *
16366  * result.view = memviewslice.memview.view
16367  * result.view.buf = <void *> memviewslice.data # <<<<<<<<<<<<<<
16368  * result.view.ndim = ndim
16369  * (<__pyx_buffer *> &result.view).obj = Py_None
16370  */
16371  __Pyx_TraceLine(1024,0,__PYX_ERR(2, 1024, __pyx_L1_error))
16372  __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
16373 
16374  /* "View.MemoryView":1025
16375  * result.view = memviewslice.memview.view
16376  * result.view.buf = <void *> memviewslice.data
16377  * result.view.ndim = ndim # <<<<<<<<<<<<<<
16378  * (<__pyx_buffer *> &result.view).obj = Py_None
16379  * Py_INCREF(Py_None)
16380  */
16381  __Pyx_TraceLine(1025,0,__PYX_ERR(2, 1025, __pyx_L1_error))
16382  __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
16383 
16384  /* "View.MemoryView":1026
16385  * result.view.buf = <void *> memviewslice.data
16386  * result.view.ndim = ndim
16387  * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<<
16388  * Py_INCREF(Py_None)
16389  *
16390  */
16391  __Pyx_TraceLine(1026,0,__PYX_ERR(2, 1026, __pyx_L1_error))
16392  ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
16393 
16394  /* "View.MemoryView":1027
16395  * result.view.ndim = ndim
16396  * (<__pyx_buffer *> &result.view).obj = Py_None
16397  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
16398  *
16399  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
16400  */
16401  __Pyx_TraceLine(1027,0,__PYX_ERR(2, 1027, __pyx_L1_error))
16402  Py_INCREF(Py_None);
16403 
16404  /* "View.MemoryView":1029
16405  * Py_INCREF(Py_None)
16406  *
16407  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
16408  * result.flags = PyBUF_RECORDS
16409  * else:
16410  */
16411  __Pyx_TraceLine(1029,0,__PYX_ERR(2, 1029, __pyx_L1_error))
16412  __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
16413  if (__pyx_t_1) {
16414 
16415  /* "View.MemoryView":1030
16416  *
16417  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
16418  * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<<
16419  * else:
16420  * result.flags = PyBUF_RECORDS_RO
16421  */
16422  __Pyx_TraceLine(1030,0,__PYX_ERR(2, 1030, __pyx_L1_error))
16423  __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
16424 
16425  /* "View.MemoryView":1029
16426  * Py_INCREF(Py_None)
16427  *
16428  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
16429  * result.flags = PyBUF_RECORDS
16430  * else:
16431  */
16432  goto __pyx_L4;
16433  }
16434 
16435  /* "View.MemoryView":1032
16436  * result.flags = PyBUF_RECORDS
16437  * else:
16438  * result.flags = PyBUF_RECORDS_RO # <<<<<<<<<<<<<<
16439  *
16440  * result.view.shape = <Py_ssize_t *> result.from_slice.shape
16441  */
16442  __Pyx_TraceLine(1032,0,__PYX_ERR(2, 1032, __pyx_L1_error))
16443  /*else*/ {
16444  __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
16445  }
16446  __pyx_L4:;
16447 
16448  /* "View.MemoryView":1034
16449  * result.flags = PyBUF_RECORDS_RO
16450  *
16451  * result.view.shape = <Py_ssize_t *> result.from_slice.shape # <<<<<<<<<<<<<<
16452  * result.view.strides = <Py_ssize_t *> result.from_slice.strides
16453  *
16454  */
16455  __Pyx_TraceLine(1034,0,__PYX_ERR(2, 1034, __pyx_L1_error))
16456  __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
16457 
16458  /* "View.MemoryView":1035
16459  *
16460  * result.view.shape = <Py_ssize_t *> result.from_slice.shape
16461  * result.view.strides = <Py_ssize_t *> result.from_slice.strides # <<<<<<<<<<<<<<
16462  *
16463  *
16464  */
16465  __Pyx_TraceLine(1035,0,__PYX_ERR(2, 1035, __pyx_L1_error))
16466  __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
16467 
16468  /* "View.MemoryView":1038
16469  *
16470  *
16471  * result.view.suboffsets = NULL # <<<<<<<<<<<<<<
16472  * for suboffset in result.from_slice.suboffsets[:ndim]:
16473  * if suboffset >= 0:
16474  */
16475  __Pyx_TraceLine(1038,0,__PYX_ERR(2, 1038, __pyx_L1_error))
16476  __pyx_v_result->__pyx_base.view.suboffsets = NULL;
16477 
16478  /* "View.MemoryView":1039
16479  *
16480  * result.view.suboffsets = NULL
16481  * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<<
16482  * if suboffset >= 0:
16483  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
16484  */
16485  __Pyx_TraceLine(1039,0,__PYX_ERR(2, 1039, __pyx_L1_error))
16486  __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
16487  for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
16488  __pyx_t_6 = __pyx_t_8;
16489  __pyx_v_suboffset = (__pyx_t_6[0]);
16490 
16491  /* "View.MemoryView":1040
16492  * result.view.suboffsets = NULL
16493  * for suboffset in result.from_slice.suboffsets[:ndim]:
16494  * if suboffset >= 0: # <<<<<<<<<<<<<<
16495  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
16496  * break
16497  */
16498  __Pyx_TraceLine(1040,0,__PYX_ERR(2, 1040, __pyx_L1_error))
16499  __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
16500  if (__pyx_t_1) {
16501 
16502  /* "View.MemoryView":1041
16503  * for suboffset in result.from_slice.suboffsets[:ndim]:
16504  * if suboffset >= 0:
16505  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets # <<<<<<<<<<<<<<
16506  * break
16507  *
16508  */
16509  __Pyx_TraceLine(1041,0,__PYX_ERR(2, 1041, __pyx_L1_error))
16510  __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
16511 
16512  /* "View.MemoryView":1042
16513  * if suboffset >= 0:
16514  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
16515  * break # <<<<<<<<<<<<<<
16516  *
16517  * result.view.len = result.view.itemsize
16518  */
16519  __Pyx_TraceLine(1042,0,__PYX_ERR(2, 1042, __pyx_L1_error))
16520  goto __pyx_L6_break;
16521 
16522  /* "View.MemoryView":1040
16523  * result.view.suboffsets = NULL
16524  * for suboffset in result.from_slice.suboffsets[:ndim]:
16525  * if suboffset >= 0: # <<<<<<<<<<<<<<
16526  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
16527  * break
16528  */
16529  }
16530  }
16531  __pyx_L6_break:;
16532 
16533  /* "View.MemoryView":1044
16534  * break
16535  *
16536  * result.view.len = result.view.itemsize # <<<<<<<<<<<<<<
16537  * for length in result.view.shape[:ndim]:
16538  * result.view.len *= length
16539  */
16540  __Pyx_TraceLine(1044,0,__PYX_ERR(2, 1044, __pyx_L1_error))
16541  __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
16542  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
16543 
16544  /* "View.MemoryView":1045
16545  *
16546  * result.view.len = result.view.itemsize
16547  * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<<
16548  * result.view.len *= length
16549  *
16550  */
16551  __Pyx_TraceLine(1045,0,__PYX_ERR(2, 1045, __pyx_L1_error))
16552  __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
16553  for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
16554  __pyx_t_6 = __pyx_t_8;
16555  __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1045, __pyx_L1_error)
16556  __Pyx_GOTREF(__pyx_t_2);
16557  __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
16558  __pyx_t_2 = 0;
16559 
16560  /* "View.MemoryView":1046
16561  * result.view.len = result.view.itemsize
16562  * for length in result.view.shape[:ndim]:
16563  * result.view.len *= length # <<<<<<<<<<<<<<
16564  *
16565  * result.to_object_func = to_object_func
16566  */
16567  __Pyx_TraceLine(1046,0,__PYX_ERR(2, 1046, __pyx_L1_error))
16568  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1046, __pyx_L1_error)
16569  __Pyx_GOTREF(__pyx_t_2);
16570  __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1046, __pyx_L1_error)
16571  __Pyx_GOTREF(__pyx_t_3);
16572  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16573  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 1046, __pyx_L1_error)
16574  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16575  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
16576  }
16577 
16578  /* "View.MemoryView":1048
16579  * result.view.len *= length
16580  *
16581  * result.to_object_func = to_object_func # <<<<<<<<<<<<<<
16582  * result.to_dtype_func = to_dtype_func
16583  *
16584  */
16585  __Pyx_TraceLine(1048,0,__PYX_ERR(2, 1048, __pyx_L1_error))
16586  __pyx_v_result->to_object_func = __pyx_v_to_object_func;
16587 
16588  /* "View.MemoryView":1049
16589  *
16590  * result.to_object_func = to_object_func
16591  * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<<
16592  *
16593  * return result
16594  */
16595  __Pyx_TraceLine(1049,0,__PYX_ERR(2, 1049, __pyx_L1_error))
16596  __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
16597 
16598  /* "View.MemoryView":1051
16599  * result.to_dtype_func = to_dtype_func
16600  *
16601  * return result # <<<<<<<<<<<<<<
16602  *
16603  * @cname('__pyx_memoryview_get_slice_from_memoryview')
16604  */
16605  __Pyx_TraceLine(1051,0,__PYX_ERR(2, 1051, __pyx_L1_error))
16606  __Pyx_XDECREF(__pyx_r);
16607  __Pyx_INCREF(((PyObject *)__pyx_v_result));
16608  __pyx_r = ((PyObject *)__pyx_v_result);
16609  goto __pyx_L0;
16610 
16611  /* "View.MemoryView":1001
16612  *
16613  * @cname('__pyx_memoryview_fromslice')
16614  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
16615  * int ndim,
16616  * object (*to_object_func)(char *),
16617  */
16618 
16619  /* function exit code */
16620  __pyx_L1_error:;
16621  __Pyx_XDECREF(__pyx_t_2);
16622  __Pyx_XDECREF(__pyx_t_3);
16623  __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16624  __pyx_r = 0;
16625  __pyx_L0:;
16626  __Pyx_XDECREF((PyObject *)__pyx_v_result);
16627  __Pyx_XDECREF(__pyx_v_length);
16628  __Pyx_XGIVEREF(__pyx_r);
16629  __Pyx_TraceReturn(__pyx_r, 0);
16630  __Pyx_RefNannyFinishContext();
16631  return __pyx_r;
16632 }
16633 
16634 /* "View.MemoryView":1054
16635  *
16636  * @cname('__pyx_memoryview_get_slice_from_memoryview')
16637  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
16638  * __Pyx_memviewslice *mslice) except NULL:
16639  * cdef _memoryviewslice obj
16640  */
16641 
16642 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
16643  struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
16644  __Pyx_memviewslice *__pyx_r;
16645  __Pyx_TraceDeclarations
16646  __Pyx_RefNannyDeclarations
16647  int __pyx_t_1;
16648  int __pyx_t_2;
16649  PyObject *__pyx_t_3 = NULL;
16650  int __pyx_lineno = 0;
16651  const char *__pyx_filename = NULL;
16652  int __pyx_clineno = 0;
16653  __Pyx_RefNannySetupContext("get_slice_from_memview", 0);
16654  __Pyx_TraceCall("get_slice_from_memview", __pyx_f[2], 1054, 0, __PYX_ERR(2, 1054, __pyx_L1_error));
16655 
16656  /* "View.MemoryView":1057
16657  * __Pyx_memviewslice *mslice) except NULL:
16658  * cdef _memoryviewslice obj
16659  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
16660  * obj = memview
16661  * return &obj.from_slice
16662  */
16663  __Pyx_TraceLine(1057,0,__PYX_ERR(2, 1057, __pyx_L1_error))
16664  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
16665  __pyx_t_2 = (__pyx_t_1 != 0);
16666  if (__pyx_t_2) {
16667 
16668  /* "View.MemoryView":1058
16669  * cdef _memoryviewslice obj
16670  * if isinstance(memview, _memoryviewslice):
16671  * obj = memview # <<<<<<<<<<<<<<
16672  * return &obj.from_slice
16673  * else:
16674  */
16675  __Pyx_TraceLine(1058,0,__PYX_ERR(2, 1058, __pyx_L1_error))
16676  if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 1058, __pyx_L1_error)
16677  __pyx_t_3 = ((PyObject *)__pyx_v_memview);
16678  __Pyx_INCREF(__pyx_t_3);
16679  __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
16680  __pyx_t_3 = 0;
16681 
16682  /* "View.MemoryView":1059
16683  * if isinstance(memview, _memoryviewslice):
16684  * obj = memview
16685  * return &obj.from_slice # <<<<<<<<<<<<<<
16686  * else:
16687  * slice_copy(memview, mslice)
16688  */
16689  __Pyx_TraceLine(1059,0,__PYX_ERR(2, 1059, __pyx_L1_error))
16690  __pyx_r = (&__pyx_v_obj->from_slice);
16691  goto __pyx_L0;
16692 
16693  /* "View.MemoryView":1057
16694  * __Pyx_memviewslice *mslice) except NULL:
16695  * cdef _memoryviewslice obj
16696  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
16697  * obj = memview
16698  * return &obj.from_slice
16699  */
16700  }
16701 
16702  /* "View.MemoryView":1061
16703  * return &obj.from_slice
16704  * else:
16705  * slice_copy(memview, mslice) # <<<<<<<<<<<<<<
16706  * return mslice
16707  *
16708  */
16709  __Pyx_TraceLine(1061,0,__PYX_ERR(2, 1061, __pyx_L1_error))
16710  /*else*/ {
16711  __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
16712 
16713  /* "View.MemoryView":1062
16714  * else:
16715  * slice_copy(memview, mslice)
16716  * return mslice # <<<<<<<<<<<<<<
16717  *
16718  * @cname('__pyx_memoryview_slice_copy')
16719  */
16720  __Pyx_TraceLine(1062,0,__PYX_ERR(2, 1062, __pyx_L1_error))
16721  __pyx_r = __pyx_v_mslice;
16722  goto __pyx_L0;
16723  }
16724 
16725  /* "View.MemoryView":1054
16726  *
16727  * @cname('__pyx_memoryview_get_slice_from_memoryview')
16728  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
16729  * __Pyx_memviewslice *mslice) except NULL:
16730  * cdef _memoryviewslice obj
16731  */
16732 
16733  /* function exit code */
16734  __pyx_L1_error:;
16735  __Pyx_XDECREF(__pyx_t_3);
16736  __Pyx_AddTraceback("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
16737  __pyx_r = NULL;
16738  __pyx_L0:;
16739  __Pyx_XDECREF((PyObject *)__pyx_v_obj);
16740  __Pyx_TraceReturn(Py_None, 0);
16741  __Pyx_RefNannyFinishContext();
16742  return __pyx_r;
16743 }
16744 
16745 /* "View.MemoryView":1065
16746  *
16747  * @cname('__pyx_memoryview_slice_copy')
16748  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
16749  * cdef int dim
16750  * cdef (Py_ssize_t*) shape, strides, suboffsets
16751  */
16752 
16753 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
16754  int __pyx_v_dim;
16755  Py_ssize_t *__pyx_v_shape;
16756  Py_ssize_t *__pyx_v_strides;
16757  Py_ssize_t *__pyx_v_suboffsets;
16758  __Pyx_TraceDeclarations
16759  __Pyx_RefNannyDeclarations
16760  Py_ssize_t *__pyx_t_1;
16761  int __pyx_t_2;
16762  int __pyx_t_3;
16763  int __pyx_t_4;
16764  Py_ssize_t __pyx_t_5;
16765  int __pyx_lineno = 0;
16766  const char *__pyx_filename = NULL;
16767  int __pyx_clineno = 0;
16768  __Pyx_RefNannySetupContext("slice_copy", 0);
16769  __Pyx_TraceCall("slice_copy", __pyx_f[2], 1065, 0, __PYX_ERR(2, 1065, __pyx_L1_error));
16770 
16771  /* "View.MemoryView":1069
16772  * cdef (Py_ssize_t*) shape, strides, suboffsets
16773  *
16774  * shape = memview.view.shape # <<<<<<<<<<<<<<
16775  * strides = memview.view.strides
16776  * suboffsets = memview.view.suboffsets
16777  */
16778  __Pyx_TraceLine(1069,0,__PYX_ERR(2, 1069, __pyx_L1_error))
16779  __pyx_t_1 = __pyx_v_memview->view.shape;
16780  __pyx_v_shape = __pyx_t_1;
16781 
16782  /* "View.MemoryView":1070
16783  *
16784  * shape = memview.view.shape
16785  * strides = memview.view.strides # <<<<<<<<<<<<<<
16786  * suboffsets = memview.view.suboffsets
16787  *
16788  */
16789  __Pyx_TraceLine(1070,0,__PYX_ERR(2, 1070, __pyx_L1_error))
16790  __pyx_t_1 = __pyx_v_memview->view.strides;
16791  __pyx_v_strides = __pyx_t_1;
16792 
16793  /* "View.MemoryView":1071
16794  * shape = memview.view.shape
16795  * strides = memview.view.strides
16796  * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<<
16797  *
16798  * dst.memview = <__pyx_memoryview *> memview
16799  */
16800  __Pyx_TraceLine(1071,0,__PYX_ERR(2, 1071, __pyx_L1_error))
16801  __pyx_t_1 = __pyx_v_memview->view.suboffsets;
16802  __pyx_v_suboffsets = __pyx_t_1;
16803 
16804  /* "View.MemoryView":1073
16805  * suboffsets = memview.view.suboffsets
16806  *
16807  * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<<
16808  * dst.data = <char *> memview.view.buf
16809  *
16810  */
16811  __Pyx_TraceLine(1073,0,__PYX_ERR(2, 1073, __pyx_L1_error))
16812  __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
16813 
16814  /* "View.MemoryView":1074
16815  *
16816  * dst.memview = <__pyx_memoryview *> memview
16817  * dst.data = <char *> memview.view.buf # <<<<<<<<<<<<<<
16818  *
16819  * for dim in range(memview.view.ndim):
16820  */
16821  __Pyx_TraceLine(1074,0,__PYX_ERR(2, 1074, __pyx_L1_error))
16822  __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
16823 
16824  /* "View.MemoryView":1076
16825  * dst.data = <char *> memview.view.buf
16826  *
16827  * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<<
16828  * dst.shape[dim] = shape[dim]
16829  * dst.strides[dim] = strides[dim]
16830  */
16831  __Pyx_TraceLine(1076,0,__PYX_ERR(2, 1076, __pyx_L1_error))
16832  __pyx_t_2 = __pyx_v_memview->view.ndim;
16833  __pyx_t_3 = __pyx_t_2;
16834  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
16835  __pyx_v_dim = __pyx_t_4;
16836 
16837  /* "View.MemoryView":1077
16838  *
16839  * for dim in range(memview.view.ndim):
16840  * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<<
16841  * dst.strides[dim] = strides[dim]
16842  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
16843  */
16844  __Pyx_TraceLine(1077,0,__PYX_ERR(2, 1077, __pyx_L1_error))
16845  (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
16846 
16847  /* "View.MemoryView":1078
16848  * for dim in range(memview.view.ndim):
16849  * dst.shape[dim] = shape[dim]
16850  * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<<
16851  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
16852  *
16853  */
16854  __Pyx_TraceLine(1078,0,__PYX_ERR(2, 1078, __pyx_L1_error))
16855  (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
16856 
16857  /* "View.MemoryView":1079
16858  * dst.shape[dim] = shape[dim]
16859  * dst.strides[dim] = strides[dim]
16860  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<<
16861  *
16862  * @cname('__pyx_memoryview_copy_object')
16863  */
16864  __Pyx_TraceLine(1079,0,__PYX_ERR(2, 1079, __pyx_L1_error))
16865  if ((__pyx_v_suboffsets != 0)) {
16866  __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
16867  } else {
16868  __pyx_t_5 = -1L;
16869  }
16870  (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
16871  }
16872 
16873  /* "View.MemoryView":1065
16874  *
16875  * @cname('__pyx_memoryview_slice_copy')
16876  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
16877  * cdef int dim
16878  * cdef (Py_ssize_t*) shape, strides, suboffsets
16879  */
16880 
16881  /* function exit code */
16882  goto __pyx_L0;
16883  __pyx_L1_error:;
16884  __Pyx_WriteUnraisable("View.MemoryView.slice_copy", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
16885  __pyx_L0:;
16886  __Pyx_TraceReturn(Py_None, 0);
16887  __Pyx_RefNannyFinishContext();
16888 }
16889 
16890 /* "View.MemoryView":1082
16891  *
16892  * @cname('__pyx_memoryview_copy_object')
16893  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
16894  * "Create a new memoryview object"
16895  * cdef __Pyx_memviewslice memviewslice
16896  */
16897 
16898 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) {
16899  __Pyx_memviewslice __pyx_v_memviewslice;
16900  PyObject *__pyx_r = NULL;
16901  __Pyx_TraceDeclarations
16902  __Pyx_RefNannyDeclarations
16903  PyObject *__pyx_t_1 = NULL;
16904  int __pyx_lineno = 0;
16905  const char *__pyx_filename = NULL;
16906  int __pyx_clineno = 0;
16907  __Pyx_RefNannySetupContext("memoryview_copy", 0);
16908  __Pyx_TraceCall("memoryview_copy", __pyx_f[2], 1082, 0, __PYX_ERR(2, 1082, __pyx_L1_error));
16909 
16910  /* "View.MemoryView":1085
16911  * "Create a new memoryview object"
16912  * cdef __Pyx_memviewslice memviewslice
16913  * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<<
16914  * return memoryview_copy_from_slice(memview, &memviewslice)
16915  *
16916  */
16917  __Pyx_TraceLine(1085,0,__PYX_ERR(2, 1085, __pyx_L1_error))
16918  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
16919 
16920  /* "View.MemoryView":1086
16921  * cdef __Pyx_memviewslice memviewslice
16922  * slice_copy(memview, &memviewslice)
16923  * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<<
16924  *
16925  * @cname('__pyx_memoryview_copy_object_from_slice')
16926  */
16927  __Pyx_TraceLine(1086,0,__PYX_ERR(2, 1086, __pyx_L1_error))
16928  __Pyx_XDECREF(__pyx_r);
16929  __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1086, __pyx_L1_error)
16930  __Pyx_GOTREF(__pyx_t_1);
16931  __pyx_r = __pyx_t_1;
16932  __pyx_t_1 = 0;
16933  goto __pyx_L0;
16934 
16935  /* "View.MemoryView":1082
16936  *
16937  * @cname('__pyx_memoryview_copy_object')
16938  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
16939  * "Create a new memoryview object"
16940  * cdef __Pyx_memviewslice memviewslice
16941  */
16942 
16943  /* function exit code */
16944  __pyx_L1_error:;
16945  __Pyx_XDECREF(__pyx_t_1);
16946  __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
16947  __pyx_r = 0;
16948  __pyx_L0:;
16949  __Pyx_XGIVEREF(__pyx_r);
16950  __Pyx_TraceReturn(__pyx_r, 0);
16951  __Pyx_RefNannyFinishContext();
16952  return __pyx_r;
16953 }
16954 
16955 /* "View.MemoryView":1089
16956  *
16957  * @cname('__pyx_memoryview_copy_object_from_slice')
16958  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
16959  * """
16960  * Create a new memoryview object from a given memoryview object and slice.
16961  */
16962 
16963 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
16964  PyObject *(*__pyx_v_to_object_func)(char *);
16965  int (*__pyx_v_to_dtype_func)(char *, PyObject *);
16966  PyObject *__pyx_r = NULL;
16967  __Pyx_TraceDeclarations
16968  __Pyx_RefNannyDeclarations
16969  int __pyx_t_1;
16970  int __pyx_t_2;
16971  PyObject *(*__pyx_t_3)(char *);
16972  int (*__pyx_t_4)(char *, PyObject *);
16973  PyObject *__pyx_t_5 = NULL;
16974  int __pyx_lineno = 0;
16975  const char *__pyx_filename = NULL;
16976  int __pyx_clineno = 0;
16977  __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0);
16978  __Pyx_TraceCall("memoryview_copy_from_slice", __pyx_f[2], 1089, 0, __PYX_ERR(2, 1089, __pyx_L1_error));
16979 
16980  /* "View.MemoryView":1096
16981  * cdef int (*to_dtype_func)(char *, object) except 0
16982  *
16983  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
16984  * to_object_func = (<_memoryviewslice> memview).to_object_func
16985  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
16986  */
16987  __Pyx_TraceLine(1096,0,__PYX_ERR(2, 1096, __pyx_L1_error))
16988  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
16989  __pyx_t_2 = (__pyx_t_1 != 0);
16990  if (__pyx_t_2) {
16991 
16992  /* "View.MemoryView":1097
16993  *
16994  * if isinstance(memview, _memoryviewslice):
16995  * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<<
16996  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
16997  * else:
16998  */
16999  __Pyx_TraceLine(1097,0,__PYX_ERR(2, 1097, __pyx_L1_error))
17000  __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
17001  __pyx_v_to_object_func = __pyx_t_3;
17002 
17003  /* "View.MemoryView":1098
17004  * if isinstance(memview, _memoryviewslice):
17005  * to_object_func = (<_memoryviewslice> memview).to_object_func
17006  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<<
17007  * else:
17008  * to_object_func = NULL
17009  */
17010  __Pyx_TraceLine(1098,0,__PYX_ERR(2, 1098, __pyx_L1_error))
17011  __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
17012  __pyx_v_to_dtype_func = __pyx_t_4;
17013 
17014  /* "View.MemoryView":1096
17015  * cdef int (*to_dtype_func)(char *, object) except 0
17016  *
17017  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
17018  * to_object_func = (<_memoryviewslice> memview).to_object_func
17019  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
17020  */
17021  goto __pyx_L3;
17022  }
17023 
17024  /* "View.MemoryView":1100
17025  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
17026  * else:
17027  * to_object_func = NULL # <<<<<<<<<<<<<<
17028  * to_dtype_func = NULL
17029  *
17030  */
17031  __Pyx_TraceLine(1100,0,__PYX_ERR(2, 1100, __pyx_L1_error))
17032  /*else*/ {
17033  __pyx_v_to_object_func = NULL;
17034 
17035  /* "View.MemoryView":1101
17036  * else:
17037  * to_object_func = NULL
17038  * to_dtype_func = NULL # <<<<<<<<<<<<<<
17039  *
17040  * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
17041  */
17042  __Pyx_TraceLine(1101,0,__PYX_ERR(2, 1101, __pyx_L1_error))
17043  __pyx_v_to_dtype_func = NULL;
17044  }
17045  __pyx_L3:;
17046 
17047  /* "View.MemoryView":1103
17048  * to_dtype_func = NULL
17049  *
17050  * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<<
17051  * to_object_func, to_dtype_func,
17052  * memview.dtype_is_object)
17053  */
17054  __Pyx_TraceLine(1103,0,__PYX_ERR(2, 1103, __pyx_L1_error))
17055  __Pyx_XDECREF(__pyx_r);
17056 
17057  /* "View.MemoryView":1105
17058  * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
17059  * to_object_func, to_dtype_func,
17060  * memview.dtype_is_object) # <<<<<<<<<<<<<<
17061  *
17062  *
17063  */
17064  __Pyx_TraceLine(1105,0,__PYX_ERR(2, 1105, __pyx_L1_error))
17065  __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1103, __pyx_L1_error)
17066  __Pyx_GOTREF(__pyx_t_5);
17067  __pyx_r = __pyx_t_5;
17068  __pyx_t_5 = 0;
17069  goto __pyx_L0;
17070 
17071  /* "View.MemoryView":1089
17072  *
17073  * @cname('__pyx_memoryview_copy_object_from_slice')
17074  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
17075  * """
17076  * Create a new memoryview object from a given memoryview object and slice.
17077  */
17078 
17079  /* function exit code */
17080  __pyx_L1_error:;
17081  __Pyx_XDECREF(__pyx_t_5);
17082  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17083  __pyx_r = 0;
17084  __pyx_L0:;
17085  __Pyx_XGIVEREF(__pyx_r);
17086  __Pyx_TraceReturn(__pyx_r, 0);
17087  __Pyx_RefNannyFinishContext();
17088  return __pyx_r;
17089 }
17090 
17091 /* "View.MemoryView":1111
17092  *
17093  *
17094  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
17095  * if arg < 0:
17096  * return -arg
17097  */
17098 
17099 static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
17100  Py_ssize_t __pyx_r;
17101  __Pyx_TraceDeclarations
17102  int __pyx_t_1;
17103  int __pyx_lineno = 0;
17104  const char *__pyx_filename = NULL;
17105  int __pyx_clineno = 0;
17106  __Pyx_TraceCall("abs_py_ssize_t", __pyx_f[2], 1111, 1, __PYX_ERR(2, 1111, __pyx_L1_error));
17107 
17108  /* "View.MemoryView":1112
17109  *
17110  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
17111  * if arg < 0: # <<<<<<<<<<<<<<
17112  * return -arg
17113  * else:
17114  */
17115  __Pyx_TraceLine(1112,1,__PYX_ERR(2, 1112, __pyx_L1_error))
17116  __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
17117  if (__pyx_t_1) {
17118 
17119  /* "View.MemoryView":1113
17120  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
17121  * if arg < 0:
17122  * return -arg # <<<<<<<<<<<<<<
17123  * else:
17124  * return arg
17125  */
17126  __Pyx_TraceLine(1113,1,__PYX_ERR(2, 1113, __pyx_L1_error))
17127  __pyx_r = (-__pyx_v_arg);
17128  goto __pyx_L0;
17129 
17130  /* "View.MemoryView":1112
17131  *
17132  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
17133  * if arg < 0: # <<<<<<<<<<<<<<
17134  * return -arg
17135  * else:
17136  */
17137  }
17138 
17139  /* "View.MemoryView":1115
17140  * return -arg
17141  * else:
17142  * return arg # <<<<<<<<<<<<<<
17143  *
17144  * @cname('__pyx_get_best_slice_order')
17145  */
17146  __Pyx_TraceLine(1115,1,__PYX_ERR(2, 1115, __pyx_L1_error))
17147  /*else*/ {
17148  __pyx_r = __pyx_v_arg;
17149  goto __pyx_L0;
17150  }
17151 
17152  /* "View.MemoryView":1111
17153  *
17154  *
17155  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
17156  * if arg < 0:
17157  * return -arg
17158  */
17159 
17160  /* function exit code */
17161  __pyx_L1_error:;
17162  __Pyx_WriteUnraisable("View.MemoryView.abs_py_ssize_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
17163  __pyx_r = 0;
17164  __pyx_L0:;
17165  __Pyx_TraceReturn(Py_None, 1);
17166  return __pyx_r;
17167 }
17168 
17169 /* "View.MemoryView":1118
17170  *
17171  * @cname('__pyx_get_best_slice_order')
17172  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
17173  * """
17174  * Figure out the best memory access order for a given slice.
17175  */
17176 
17177 static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
17178  int __pyx_v_i;
17179  Py_ssize_t __pyx_v_c_stride;
17180  Py_ssize_t __pyx_v_f_stride;
17181  char __pyx_r;
17182  __Pyx_TraceDeclarations
17183  int __pyx_t_1;
17184  int __pyx_t_2;
17185  int __pyx_t_3;
17186  int __pyx_t_4;
17187  int __pyx_lineno = 0;
17188  const char *__pyx_filename = NULL;
17189  int __pyx_clineno = 0;
17190  __Pyx_TraceCall("get_best_order", __pyx_f[2], 1118, 1, __PYX_ERR(2, 1118, __pyx_L1_error));
17191 
17192  /* "View.MemoryView":1123
17193  * """
17194  * cdef int i
17195  * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<<
17196  * cdef Py_ssize_t f_stride = 0
17197  *
17198  */
17199  __Pyx_TraceLine(1123,1,__PYX_ERR(2, 1123, __pyx_L1_error))
17200  __pyx_v_c_stride = 0;
17201 
17202  /* "View.MemoryView":1124
17203  * cdef int i
17204  * cdef Py_ssize_t c_stride = 0
17205  * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<<
17206  *
17207  * for i in range(ndim - 1, -1, -1):
17208  */
17209  __Pyx_TraceLine(1124,1,__PYX_ERR(2, 1124, __pyx_L1_error))
17210  __pyx_v_f_stride = 0;
17211 
17212  /* "View.MemoryView":1126
17213  * cdef Py_ssize_t f_stride = 0
17214  *
17215  * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
17216  * if mslice.shape[i] > 1:
17217  * c_stride = mslice.strides[i]
17218  */
17219  __Pyx_TraceLine(1126,1,__PYX_ERR(2, 1126, __pyx_L1_error))
17220  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
17221  __pyx_v_i = __pyx_t_1;
17222 
17223  /* "View.MemoryView":1127
17224  *
17225  * for i in range(ndim - 1, -1, -1):
17226  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
17227  * c_stride = mslice.strides[i]
17228  * break
17229  */
17230  __Pyx_TraceLine(1127,1,__PYX_ERR(2, 1127, __pyx_L1_error))
17231  __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
17232  if (__pyx_t_2) {
17233 
17234  /* "View.MemoryView":1128
17235  * for i in range(ndim - 1, -1, -1):
17236  * if mslice.shape[i] > 1:
17237  * c_stride = mslice.strides[i] # <<<<<<<<<<<<<<
17238  * break
17239  *
17240  */
17241  __Pyx_TraceLine(1128,1,__PYX_ERR(2, 1128, __pyx_L1_error))
17242  __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
17243 
17244  /* "View.MemoryView":1129
17245  * if mslice.shape[i] > 1:
17246  * c_stride = mslice.strides[i]
17247  * break # <<<<<<<<<<<<<<
17248  *
17249  * for i in range(ndim):
17250  */
17251  __Pyx_TraceLine(1129,1,__PYX_ERR(2, 1129, __pyx_L1_error))
17252  goto __pyx_L4_break;
17253 
17254  /* "View.MemoryView":1127
17255  *
17256  * for i in range(ndim - 1, -1, -1):
17257  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
17258  * c_stride = mslice.strides[i]
17259  * break
17260  */
17261  }
17262  }
17263  __pyx_L4_break:;
17264 
17265  /* "View.MemoryView":1131
17266  * break
17267  *
17268  * for i in range(ndim): # <<<<<<<<<<<<<<
17269  * if mslice.shape[i] > 1:
17270  * f_stride = mslice.strides[i]
17271  */
17272  __Pyx_TraceLine(1131,1,__PYX_ERR(2, 1131, __pyx_L1_error))
17273  __pyx_t_1 = __pyx_v_ndim;
17274  __pyx_t_3 = __pyx_t_1;
17275  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17276  __pyx_v_i = __pyx_t_4;
17277 
17278  /* "View.MemoryView":1132
17279  *
17280  * for i in range(ndim):
17281  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
17282  * f_stride = mslice.strides[i]
17283  * break
17284  */
17285  __Pyx_TraceLine(1132,1,__PYX_ERR(2, 1132, __pyx_L1_error))
17286  __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
17287  if (__pyx_t_2) {
17288 
17289  /* "View.MemoryView":1133
17290  * for i in range(ndim):
17291  * if mslice.shape[i] > 1:
17292  * f_stride = mslice.strides[i] # <<<<<<<<<<<<<<
17293  * break
17294  *
17295  */
17296  __Pyx_TraceLine(1133,1,__PYX_ERR(2, 1133, __pyx_L1_error))
17297  __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
17298 
17299  /* "View.MemoryView":1134
17300  * if mslice.shape[i] > 1:
17301  * f_stride = mslice.strides[i]
17302  * break # <<<<<<<<<<<<<<
17303  *
17304  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
17305  */
17306  __Pyx_TraceLine(1134,1,__PYX_ERR(2, 1134, __pyx_L1_error))
17307  goto __pyx_L7_break;
17308 
17309  /* "View.MemoryView":1132
17310  *
17311  * for i in range(ndim):
17312  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
17313  * f_stride = mslice.strides[i]
17314  * break
17315  */
17316  }
17317  }
17318  __pyx_L7_break:;
17319 
17320  /* "View.MemoryView":1136
17321  * break
17322  *
17323  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
17324  * return 'C'
17325  * else:
17326  */
17327  __Pyx_TraceLine(1136,1,__PYX_ERR(2, 1136, __pyx_L1_error))
17328  __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
17329  if (__pyx_t_2) {
17330 
17331  /* "View.MemoryView":1137
17332  *
17333  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
17334  * return 'C' # <<<<<<<<<<<<<<
17335  * else:
17336  * return 'F'
17337  */
17338  __Pyx_TraceLine(1137,1,__PYX_ERR(2, 1137, __pyx_L1_error))
17339  __pyx_r = 'C';
17340  goto __pyx_L0;
17341 
17342  /* "View.MemoryView":1136
17343  * break
17344  *
17345  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
17346  * return 'C'
17347  * else:
17348  */
17349  }
17350 
17351  /* "View.MemoryView":1139
17352  * return 'C'
17353  * else:
17354  * return 'F' # <<<<<<<<<<<<<<
17355  *
17356  * @cython.cdivision(True)
17357  */
17358  __Pyx_TraceLine(1139,1,__PYX_ERR(2, 1139, __pyx_L1_error))
17359  /*else*/ {
17360  __pyx_r = 'F';
17361  goto __pyx_L0;
17362  }
17363 
17364  /* "View.MemoryView":1118
17365  *
17366  * @cname('__pyx_get_best_slice_order')
17367  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
17368  * """
17369  * Figure out the best memory access order for a given slice.
17370  */
17371 
17372  /* function exit code */
17373  __pyx_L1_error:;
17374  __Pyx_WriteUnraisable("View.MemoryView.get_best_order", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
17375  __pyx_r = 0;
17376  __pyx_L0:;
17377  __Pyx_TraceReturn(Py_None, 1);
17378  return __pyx_r;
17379 }
17380 
17381 /* "View.MemoryView":1142
17382  *
17383  * @cython.cdivision(True)
17384  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
17385  * char *dst_data, Py_ssize_t *dst_strides,
17386  * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
17387  */
17388 
17389 static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
17390  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
17391  CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
17392  Py_ssize_t __pyx_v_dst_extent;
17393  Py_ssize_t __pyx_v_src_stride;
17394  Py_ssize_t __pyx_v_dst_stride;
17395  int __pyx_t_1;
17396  int __pyx_t_2;
17397  int __pyx_t_3;
17398  Py_ssize_t __pyx_t_4;
17399  Py_ssize_t __pyx_t_5;
17400  Py_ssize_t __pyx_t_6;
17401 
17402  /* "View.MemoryView":1149
17403  *
17404  * cdef Py_ssize_t i
17405  * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<<
17406  * cdef Py_ssize_t dst_extent = dst_shape[0]
17407  * cdef Py_ssize_t src_stride = src_strides[0]
17408  */
17409  __pyx_v_src_extent = (__pyx_v_src_shape[0]);
17410 
17411  /* "View.MemoryView":1150
17412  * cdef Py_ssize_t i
17413  * cdef Py_ssize_t src_extent = src_shape[0]
17414  * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<<
17415  * cdef Py_ssize_t src_stride = src_strides[0]
17416  * cdef Py_ssize_t dst_stride = dst_strides[0]
17417  */
17418  __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
17419 
17420  /* "View.MemoryView":1151
17421  * cdef Py_ssize_t src_extent = src_shape[0]
17422  * cdef Py_ssize_t dst_extent = dst_shape[0]
17423  * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<<
17424  * cdef Py_ssize_t dst_stride = dst_strides[0]
17425  *
17426  */
17427  __pyx_v_src_stride = (__pyx_v_src_strides[0]);
17428 
17429  /* "View.MemoryView":1152
17430  * cdef Py_ssize_t dst_extent = dst_shape[0]
17431  * cdef Py_ssize_t src_stride = src_strides[0]
17432  * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<<
17433  *
17434  * if ndim == 1:
17435  */
17436  __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
17437 
17438  /* "View.MemoryView":1154
17439  * cdef Py_ssize_t dst_stride = dst_strides[0]
17440  *
17441  * if ndim == 1: # <<<<<<<<<<<<<<
17442  * if (src_stride > 0 and dst_stride > 0 and
17443  * <size_t> src_stride == itemsize == <size_t> dst_stride):
17444  */
17445  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
17446  if (__pyx_t_1) {
17447 
17448  /* "View.MemoryView":1155
17449  *
17450  * if ndim == 1:
17451  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
17452  * <size_t> src_stride == itemsize == <size_t> dst_stride):
17453  * memcpy(dst_data, src_data, itemsize * dst_extent)
17454  */
17455  __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
17456  if (__pyx_t_2) {
17457  } else {
17458  __pyx_t_1 = __pyx_t_2;
17459  goto __pyx_L5_bool_binop_done;
17460  }
17461  __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
17462  if (__pyx_t_2) {
17463  } else {
17464  __pyx_t_1 = __pyx_t_2;
17465  goto __pyx_L5_bool_binop_done;
17466  }
17467 
17468  /* "View.MemoryView":1156
17469  * if ndim == 1:
17470  * if (src_stride > 0 and dst_stride > 0 and
17471  * <size_t> src_stride == itemsize == <size_t> dst_stride): # <<<<<<<<<<<<<<
17472  * memcpy(dst_data, src_data, itemsize * dst_extent)
17473  * else:
17474  */
17475  __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
17476  if (__pyx_t_2) {
17477  __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
17478  }
17479  __pyx_t_3 = (__pyx_t_2 != 0);
17480  __pyx_t_1 = __pyx_t_3;
17481  __pyx_L5_bool_binop_done:;
17482 
17483  /* "View.MemoryView":1155
17484  *
17485  * if ndim == 1:
17486  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
17487  * <size_t> src_stride == itemsize == <size_t> dst_stride):
17488  * memcpy(dst_data, src_data, itemsize * dst_extent)
17489  */
17490  if (__pyx_t_1) {
17491 
17492  /* "View.MemoryView":1157
17493  * if (src_stride > 0 and dst_stride > 0 and
17494  * <size_t> src_stride == itemsize == <size_t> dst_stride):
17495  * memcpy(dst_data, src_data, itemsize * dst_extent) # <<<<<<<<<<<<<<
17496  * else:
17497  * for i in range(dst_extent):
17498  */
17499  (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
17500 
17501  /* "View.MemoryView":1155
17502  *
17503  * if ndim == 1:
17504  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
17505  * <size_t> src_stride == itemsize == <size_t> dst_stride):
17506  * memcpy(dst_data, src_data, itemsize * dst_extent)
17507  */
17508  goto __pyx_L4;
17509  }
17510 
17511  /* "View.MemoryView":1159
17512  * memcpy(dst_data, src_data, itemsize * dst_extent)
17513  * else:
17514  * for i in range(dst_extent): # <<<<<<<<<<<<<<
17515  * memcpy(dst_data, src_data, itemsize)
17516  * src_data += src_stride
17517  */
17518  /*else*/ {
17519  __pyx_t_4 = __pyx_v_dst_extent;
17520  __pyx_t_5 = __pyx_t_4;
17521  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
17522  __pyx_v_i = __pyx_t_6;
17523 
17524  /* "View.MemoryView":1160
17525  * else:
17526  * for i in range(dst_extent):
17527  * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<<
17528  * src_data += src_stride
17529  * dst_data += dst_stride
17530  */
17531  (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
17532 
17533  /* "View.MemoryView":1161
17534  * for i in range(dst_extent):
17535  * memcpy(dst_data, src_data, itemsize)
17536  * src_data += src_stride # <<<<<<<<<<<<<<
17537  * dst_data += dst_stride
17538  * else:
17539  */
17540  __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
17541 
17542  /* "View.MemoryView":1162
17543  * memcpy(dst_data, src_data, itemsize)
17544  * src_data += src_stride
17545  * dst_data += dst_stride # <<<<<<<<<<<<<<
17546  * else:
17547  * for i in range(dst_extent):
17548  */
17549  __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
17550  }
17551  }
17552  __pyx_L4:;
17553 
17554  /* "View.MemoryView":1154
17555  * cdef Py_ssize_t dst_stride = dst_strides[0]
17556  *
17557  * if ndim == 1: # <<<<<<<<<<<<<<
17558  * if (src_stride > 0 and dst_stride > 0 and
17559  * <size_t> src_stride == itemsize == <size_t> dst_stride):
17560  */
17561  goto __pyx_L3;
17562  }
17563 
17564  /* "View.MemoryView":1164
17565  * dst_data += dst_stride
17566  * else:
17567  * for i in range(dst_extent): # <<<<<<<<<<<<<<
17568  * _copy_strided_to_strided(src_data, src_strides + 1,
17569  * dst_data, dst_strides + 1,
17570  */
17571  /*else*/ {
17572  __pyx_t_4 = __pyx_v_dst_extent;
17573  __pyx_t_5 = __pyx_t_4;
17574  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
17575  __pyx_v_i = __pyx_t_6;
17576 
17577  /* "View.MemoryView":1165
17578  * else:
17579  * for i in range(dst_extent):
17580  * _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<<
17581  * dst_data, dst_strides + 1,
17582  * src_shape + 1, dst_shape + 1,
17583  */
17584  _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);
17585 
17586  /* "View.MemoryView":1169
17587  * src_shape + 1, dst_shape + 1,
17588  * ndim - 1, itemsize)
17589  * src_data += src_stride # <<<<<<<<<<<<<<
17590  * dst_data += dst_stride
17591  *
17592  */
17593  __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
17594 
17595  /* "View.MemoryView":1170
17596  * ndim - 1, itemsize)
17597  * src_data += src_stride
17598  * dst_data += dst_stride # <<<<<<<<<<<<<<
17599  *
17600  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
17601  */
17602  __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
17603  }
17604  }
17605  __pyx_L3:;
17606 
17607  /* "View.MemoryView":1142
17608  *
17609  * @cython.cdivision(True)
17610  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
17611  * char *dst_data, Py_ssize_t *dst_strides,
17612  * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
17613  */
17614 
17615  /* function exit code */
17616 }
17617 
17618 /* "View.MemoryView":1172
17619  * dst_data += dst_stride
17620  *
17621  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
17622  * __Pyx_memviewslice *dst,
17623  * int ndim, size_t itemsize) nogil:
17624  */
17625 
17626 static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
17627  __Pyx_TraceDeclarations
17628  int __pyx_lineno = 0;
17629  const char *__pyx_filename = NULL;
17630  int __pyx_clineno = 0;
17631  __Pyx_TraceCall("copy_strided_to_strided", __pyx_f[2], 1172, 1, __PYX_ERR(2, 1172, __pyx_L1_error));
17632 
17633  /* "View.MemoryView":1175
17634  * __Pyx_memviewslice *dst,
17635  * int ndim, size_t itemsize) nogil:
17636  * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<<
17637  * src.shape, dst.shape, ndim, itemsize)
17638  *
17639  */
17640  __Pyx_TraceLine(1175,1,__PYX_ERR(2, 1175, __pyx_L1_error))
17641  _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);
17642 
17643  /* "View.MemoryView":1172
17644  * dst_data += dst_stride
17645  *
17646  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
17647  * __Pyx_memviewslice *dst,
17648  * int ndim, size_t itemsize) nogil:
17649  */
17650 
17651  /* function exit code */
17652  goto __pyx_L0;
17653  __pyx_L1_error:;
17654  __Pyx_WriteUnraisable("View.MemoryView.copy_strided_to_strided", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
17655  __pyx_L0:;
17656  __Pyx_TraceReturn(Py_None, 1);
17657 }
17658 
17659 /* "View.MemoryView":1179
17660  *
17661  * @cname('__pyx_memoryview_slice_get_size')
17662  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
17663  * "Return the size of the memory occupied by the slice in number of bytes"
17664  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
17665  */
17666 
17667 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) {
17668  Py_ssize_t __pyx_v_shape;
17669  Py_ssize_t __pyx_v_size;
17670  Py_ssize_t __pyx_r;
17671  __Pyx_TraceDeclarations
17672  Py_ssize_t __pyx_t_1;
17673  Py_ssize_t *__pyx_t_2;
17674  Py_ssize_t *__pyx_t_3;
17675  Py_ssize_t *__pyx_t_4;
17676  int __pyx_lineno = 0;
17677  const char *__pyx_filename = NULL;
17678  int __pyx_clineno = 0;
17679  __Pyx_TraceCall("slice_get_size", __pyx_f[2], 1179, 1, __PYX_ERR(2, 1179, __pyx_L1_error));
17680 
17681  /* "View.MemoryView":1181
17682  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil:
17683  * "Return the size of the memory occupied by the slice in number of bytes"
17684  * cdef Py_ssize_t shape, size = src.memview.view.itemsize # <<<<<<<<<<<<<<
17685  *
17686  * for shape in src.shape[:ndim]:
17687  */
17688  __Pyx_TraceLine(1181,1,__PYX_ERR(2, 1181, __pyx_L1_error))
17689  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
17690  __pyx_v_size = __pyx_t_1;
17691 
17692  /* "View.MemoryView":1183
17693  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
17694  *
17695  * for shape in src.shape[:ndim]: # <<<<<<<<<<<<<<
17696  * size *= shape
17697  *
17698  */
17699  __Pyx_TraceLine(1183,1,__PYX_ERR(2, 1183, __pyx_L1_error))
17700  __pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim);
17701  for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
17702  __pyx_t_2 = __pyx_t_4;
17703  __pyx_v_shape = (__pyx_t_2[0]);
17704 
17705  /* "View.MemoryView":1184
17706  *
17707  * for shape in src.shape[:ndim]:
17708  * size *= shape # <<<<<<<<<<<<<<
17709  *
17710  * return size
17711  */
17712  __Pyx_TraceLine(1184,1,__PYX_ERR(2, 1184, __pyx_L1_error))
17713  __pyx_v_size = (__pyx_v_size * __pyx_v_shape);
17714  }
17715 
17716  /* "View.MemoryView":1186
17717  * size *= shape
17718  *
17719  * return size # <<<<<<<<<<<<<<
17720  *
17721  * @cname('__pyx_fill_contig_strides_array')
17722  */
17723  __Pyx_TraceLine(1186,1,__PYX_ERR(2, 1186, __pyx_L1_error))
17724  __pyx_r = __pyx_v_size;
17725  goto __pyx_L0;
17726 
17727  /* "View.MemoryView":1179
17728  *
17729  * @cname('__pyx_memoryview_slice_get_size')
17730  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
17731  * "Return the size of the memory occupied by the slice in number of bytes"
17732  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
17733  */
17734 
17735  /* function exit code */
17736  __pyx_L1_error:;
17737  __Pyx_WriteUnraisable("View.MemoryView.slice_get_size", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
17738  __pyx_r = 0;
17739  __pyx_L0:;
17740  __Pyx_TraceReturn(Py_None, 1);
17741  return __pyx_r;
17742 }
17743 
17744 /* "View.MemoryView":1189
17745  *
17746  * @cname('__pyx_fill_contig_strides_array')
17747  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
17748  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
17749  * int ndim, char order) nogil:
17750  */
17751 
17752 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) {
17753  int __pyx_v_idx;
17754  Py_ssize_t __pyx_r;
17755  __Pyx_TraceDeclarations
17756  int __pyx_t_1;
17757  int __pyx_t_2;
17758  int __pyx_t_3;
17759  int __pyx_t_4;
17760  int __pyx_lineno = 0;
17761  const char *__pyx_filename = NULL;
17762  int __pyx_clineno = 0;
17763  __Pyx_TraceCall("fill_contig_strides_array", __pyx_f[2], 1189, 1, __PYX_ERR(2, 1189, __pyx_L1_error));
17764 
17765  /* "View.MemoryView":1198
17766  * cdef int idx
17767  *
17768  * if order == 'F': # <<<<<<<<<<<<<<
17769  * for idx in range(ndim):
17770  * strides[idx] = stride
17771  */
17772  __Pyx_TraceLine(1198,1,__PYX_ERR(2, 1198, __pyx_L1_error))
17773  __pyx_t_1 = ((__pyx_v_order == 'F') != 0);
17774  if (__pyx_t_1) {
17775 
17776  /* "View.MemoryView":1199
17777  *
17778  * if order == 'F':
17779  * for idx in range(ndim): # <<<<<<<<<<<<<<
17780  * strides[idx] = stride
17781  * stride *= shape[idx]
17782  */
17783  __Pyx_TraceLine(1199,1,__PYX_ERR(2, 1199, __pyx_L1_error))
17784  __pyx_t_2 = __pyx_v_ndim;
17785  __pyx_t_3 = __pyx_t_2;
17786  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17787  __pyx_v_idx = __pyx_t_4;
17788 
17789  /* "View.MemoryView":1200
17790  * if order == 'F':
17791  * for idx in range(ndim):
17792  * strides[idx] = stride # <<<<<<<<<<<<<<
17793  * stride *= shape[idx]
17794  * else:
17795  */
17796  __Pyx_TraceLine(1200,1,__PYX_ERR(2, 1200, __pyx_L1_error))
17797  (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
17798 
17799  /* "View.MemoryView":1201
17800  * for idx in range(ndim):
17801  * strides[idx] = stride
17802  * stride *= shape[idx] # <<<<<<<<<<<<<<
17803  * else:
17804  * for idx in range(ndim - 1, -1, -1):
17805  */
17806  __Pyx_TraceLine(1201,1,__PYX_ERR(2, 1201, __pyx_L1_error))
17807  __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
17808  }
17809 
17810  /* "View.MemoryView":1198
17811  * cdef int idx
17812  *
17813  * if order == 'F': # <<<<<<<<<<<<<<
17814  * for idx in range(ndim):
17815  * strides[idx] = stride
17816  */
17817  goto __pyx_L3;
17818  }
17819 
17820  /* "View.MemoryView":1203
17821  * stride *= shape[idx]
17822  * else:
17823  * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
17824  * strides[idx] = stride
17825  * stride *= shape[idx]
17826  */
17827  __Pyx_TraceLine(1203,1,__PYX_ERR(2, 1203, __pyx_L1_error))
17828  /*else*/ {
17829  for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
17830  __pyx_v_idx = __pyx_t_2;
17831 
17832  /* "View.MemoryView":1204
17833  * else:
17834  * for idx in range(ndim - 1, -1, -1):
17835  * strides[idx] = stride # <<<<<<<<<<<<<<
17836  * stride *= shape[idx]
17837  *
17838  */
17839  __Pyx_TraceLine(1204,1,__PYX_ERR(2, 1204, __pyx_L1_error))
17840  (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
17841 
17842  /* "View.MemoryView":1205
17843  * for idx in range(ndim - 1, -1, -1):
17844  * strides[idx] = stride
17845  * stride *= shape[idx] # <<<<<<<<<<<<<<
17846  *
17847  * return stride
17848  */
17849  __Pyx_TraceLine(1205,1,__PYX_ERR(2, 1205, __pyx_L1_error))
17850  __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
17851  }
17852  }
17853  __pyx_L3:;
17854 
17855  /* "View.MemoryView":1207
17856  * stride *= shape[idx]
17857  *
17858  * return stride # <<<<<<<<<<<<<<
17859  *
17860  * @cname('__pyx_memoryview_copy_data_to_temp')
17861  */
17862  __Pyx_TraceLine(1207,1,__PYX_ERR(2, 1207, __pyx_L1_error))
17863  __pyx_r = __pyx_v_stride;
17864  goto __pyx_L0;
17865 
17866  /* "View.MemoryView":1189
17867  *
17868  * @cname('__pyx_fill_contig_strides_array')
17869  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
17870  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
17871  * int ndim, char order) nogil:
17872  */
17873 
17874  /* function exit code */
17875  __pyx_L1_error:;
17876  __Pyx_WriteUnraisable("View.MemoryView.fill_contig_strides_array", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
17877  __pyx_r = 0;
17878  __pyx_L0:;
17879  __Pyx_TraceReturn(Py_None, 1);
17880  return __pyx_r;
17881 }
17882 
17883 /* "View.MemoryView":1210
17884  *
17885  * @cname('__pyx_memoryview_copy_data_to_temp')
17886  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
17887  * __Pyx_memviewslice *tmpslice,
17888  * char order,
17889  */
17890 
17891 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice, char __pyx_v_order, int __pyx_v_ndim) {
17892  int __pyx_v_i;
17893  void *__pyx_v_result;
17894  size_t __pyx_v_itemsize;
17895  size_t __pyx_v_size;
17896  void *__pyx_r;
17897  __Pyx_TraceDeclarations
17898  Py_ssize_t __pyx_t_1;
17899  int __pyx_t_2;
17900  int __pyx_t_3;
17901  struct __pyx_memoryview_obj *__pyx_t_4;
17902  int __pyx_t_5;
17903  int __pyx_t_6;
17904  int __pyx_lineno = 0;
17905  const char *__pyx_filename = NULL;
17906  int __pyx_clineno = 0;
17907  __Pyx_TraceCall("copy_data_to_temp", __pyx_f[2], 1210, 1, __PYX_ERR(2, 1210, __pyx_L1_error));
17908 
17909  /* "View.MemoryView":1221
17910  * cdef void *result
17911  *
17912  * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
17913  * cdef size_t size = slice_get_size(src, ndim)
17914  *
17915  */
17916  __Pyx_TraceLine(1221,1,__PYX_ERR(2, 1221, __pyx_L1_error))
17917  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
17918  __pyx_v_itemsize = __pyx_t_1;
17919 
17920  /* "View.MemoryView":1222
17921  *
17922  * cdef size_t itemsize = src.memview.view.itemsize
17923  * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<<
17924  *
17925  * result = malloc(size)
17926  */
17927  __Pyx_TraceLine(1222,1,__PYX_ERR(2, 1222, __pyx_L1_error))
17928  __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
17929 
17930  /* "View.MemoryView":1224
17931  * cdef size_t size = slice_get_size(src, ndim)
17932  *
17933  * result = malloc(size) # <<<<<<<<<<<<<<
17934  * if not result:
17935  * _err(MemoryError, NULL)
17936  */
17937  __Pyx_TraceLine(1224,1,__PYX_ERR(2, 1224, __pyx_L1_error))
17938  __pyx_v_result = malloc(__pyx_v_size);
17939 
17940  /* "View.MemoryView":1225
17941  *
17942  * result = malloc(size)
17943  * if not result: # <<<<<<<<<<<<<<
17944  * _err(MemoryError, NULL)
17945  *
17946  */
17947  __Pyx_TraceLine(1225,1,__PYX_ERR(2, 1225, __pyx_L1_error))
17948  __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
17949  if (__pyx_t_2) {
17950 
17951  /* "View.MemoryView":1226
17952  * result = malloc(size)
17953  * if not result:
17954  * _err(MemoryError, NULL) # <<<<<<<<<<<<<<
17955  *
17956  *
17957  */
17958  __Pyx_TraceLine(1226,1,__PYX_ERR(2, 1226, __pyx_L1_error))
17959  __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 1226, __pyx_L1_error)
17960 
17961  /* "View.MemoryView":1225
17962  *
17963  * result = malloc(size)
17964  * if not result: # <<<<<<<<<<<<<<
17965  * _err(MemoryError, NULL)
17966  *
17967  */
17968  }
17969 
17970  /* "View.MemoryView":1229
17971  *
17972  *
17973  * tmpslice.data = <char *> result # <<<<<<<<<<<<<<
17974  * tmpslice.memview = src.memview
17975  * for i in range(ndim):
17976  */
17977  __Pyx_TraceLine(1229,1,__PYX_ERR(2, 1229, __pyx_L1_error))
17978  __pyx_v_tmpslice->data = ((char *)__pyx_v_result);
17979 
17980  /* "View.MemoryView":1230
17981  *
17982  * tmpslice.data = <char *> result
17983  * tmpslice.memview = src.memview # <<<<<<<<<<<<<<
17984  * for i in range(ndim):
17985  * tmpslice.shape[i] = src.shape[i]
17986  */
17987  __Pyx_TraceLine(1230,1,__PYX_ERR(2, 1230, __pyx_L1_error))
17988  __pyx_t_4 = __pyx_v_src->memview;
17989  __pyx_v_tmpslice->memview = __pyx_t_4;
17990 
17991  /* "View.MemoryView":1231
17992  * tmpslice.data = <char *> result
17993  * tmpslice.memview = src.memview
17994  * for i in range(ndim): # <<<<<<<<<<<<<<
17995  * tmpslice.shape[i] = src.shape[i]
17996  * tmpslice.suboffsets[i] = -1
17997  */
17998  __Pyx_TraceLine(1231,1,__PYX_ERR(2, 1231, __pyx_L1_error))
17999  __pyx_t_3 = __pyx_v_ndim;
18000  __pyx_t_5 = __pyx_t_3;
18001  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18002  __pyx_v_i = __pyx_t_6;
18003 
18004  /* "View.MemoryView":1232
18005  * tmpslice.memview = src.memview
18006  * for i in range(ndim):
18007  * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<<
18008  * tmpslice.suboffsets[i] = -1
18009  *
18010  */
18011  __Pyx_TraceLine(1232,1,__PYX_ERR(2, 1232, __pyx_L1_error))
18012  (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
18013 
18014  /* "View.MemoryView":1233
18015  * for i in range(ndim):
18016  * tmpslice.shape[i] = src.shape[i]
18017  * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
18018  *
18019  * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,
18020  */
18021  __Pyx_TraceLine(1233,1,__PYX_ERR(2, 1233, __pyx_L1_error))
18022  (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
18023  }
18024 
18025  /* "View.MemoryView":1235
18026  * tmpslice.suboffsets[i] = -1
18027  *
18028  * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<<
18029  * ndim, order)
18030  *
18031  */
18032  __Pyx_TraceLine(1235,1,__PYX_ERR(2, 1235, __pyx_L1_error))
18033  (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order));
18034 
18035  /* "View.MemoryView":1239
18036  *
18037  *
18038  * for i in range(ndim): # <<<<<<<<<<<<<<
18039  * if tmpslice.shape[i] == 1:
18040  * tmpslice.strides[i] = 0
18041  */
18042  __Pyx_TraceLine(1239,1,__PYX_ERR(2, 1239, __pyx_L1_error))
18043  __pyx_t_3 = __pyx_v_ndim;
18044  __pyx_t_5 = __pyx_t_3;
18045  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18046  __pyx_v_i = __pyx_t_6;
18047 
18048  /* "View.MemoryView":1240
18049  *
18050  * for i in range(ndim):
18051  * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
18052  * tmpslice.strides[i] = 0
18053  *
18054  */
18055  __Pyx_TraceLine(1240,1,__PYX_ERR(2, 1240, __pyx_L1_error))
18056  __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
18057  if (__pyx_t_2) {
18058 
18059  /* "View.MemoryView":1241
18060  * for i in range(ndim):
18061  * if tmpslice.shape[i] == 1:
18062  * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<<
18063  *
18064  * if slice_is_contig(src[0], order, ndim):
18065  */
18066  __Pyx_TraceLine(1241,1,__PYX_ERR(2, 1241, __pyx_L1_error))
18067  (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
18068 
18069  /* "View.MemoryView":1240
18070  *
18071  * for i in range(ndim):
18072  * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
18073  * tmpslice.strides[i] = 0
18074  *
18075  */
18076  }
18077  }
18078 
18079  /* "View.MemoryView":1243
18080  * tmpslice.strides[i] = 0
18081  *
18082  * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
18083  * memcpy(result, src.data, size)
18084  * else:
18085  */
18086  __Pyx_TraceLine(1243,1,__PYX_ERR(2, 1243, __pyx_L1_error))
18087  __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
18088  if (__pyx_t_2) {
18089 
18090  /* "View.MemoryView":1244
18091  *
18092  * if slice_is_contig(src[0], order, ndim):
18093  * memcpy(result, src.data, size) # <<<<<<<<<<<<<<
18094  * else:
18095  * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
18096  */
18097  __Pyx_TraceLine(1244,1,__PYX_ERR(2, 1244, __pyx_L1_error))
18098  (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
18099 
18100  /* "View.MemoryView":1243
18101  * tmpslice.strides[i] = 0
18102  *
18103  * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
18104  * memcpy(result, src.data, size)
18105  * else:
18106  */
18107  goto __pyx_L9;
18108  }
18109 
18110  /* "View.MemoryView":1246
18111  * memcpy(result, src.data, size)
18112  * else:
18113  * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<<
18114  *
18115  * return result
18116  */
18117  __Pyx_TraceLine(1246,1,__PYX_ERR(2, 1246, __pyx_L1_error))
18118  /*else*/ {
18119  copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
18120  }
18121  __pyx_L9:;
18122 
18123  /* "View.MemoryView":1248
18124  * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
18125  *
18126  * return result # <<<<<<<<<<<<<<
18127  *
18128  *
18129  */
18130  __Pyx_TraceLine(1248,1,__PYX_ERR(2, 1248, __pyx_L1_error))
18131  __pyx_r = __pyx_v_result;
18132  goto __pyx_L0;
18133 
18134  /* "View.MemoryView":1210
18135  *
18136  * @cname('__pyx_memoryview_copy_data_to_temp')
18137  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
18138  * __Pyx_memviewslice *tmpslice,
18139  * char order,
18140  */
18141 
18142  /* function exit code */
18143  __pyx_L1_error:;
18144  {
18145  #ifdef WITH_THREAD
18146  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18147  #endif
18148  __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
18149  #ifdef WITH_THREAD
18150  __Pyx_PyGILState_Release(__pyx_gilstate_save);
18151  #endif
18152  }
18153  __pyx_r = NULL;
18154  __pyx_L0:;
18155  __Pyx_TraceReturn(Py_None, 1);
18156  return __pyx_r;
18157 }
18158 
18159 /* "View.MemoryView":1253
18160  *
18161  * @cname('__pyx_memoryview_err_extents')
18162  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
18163  * Py_ssize_t extent2) except -1 with gil:
18164  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
18165  */
18166 
18167 static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
18168  int __pyx_r;
18169  __Pyx_TraceDeclarations
18170  __Pyx_RefNannyDeclarations
18171  PyObject *__pyx_t_1 = NULL;
18172  PyObject *__pyx_t_2 = NULL;
18173  PyObject *__pyx_t_3 = NULL;
18174  PyObject *__pyx_t_4 = NULL;
18175  int __pyx_lineno = 0;
18176  const char *__pyx_filename = NULL;
18177  int __pyx_clineno = 0;
18178  #ifdef WITH_THREAD
18179  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18180  #endif
18181  __Pyx_RefNannySetupContext("_err_extents", 0);
18182  __Pyx_TraceCall("_err_extents", __pyx_f[2], 1253, 0, __PYX_ERR(2, 1253, __pyx_L1_error));
18183 
18184  /* "View.MemoryView":1256
18185  * Py_ssize_t extent2) except -1 with gil:
18186  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
18187  * (i, extent1, extent2)) # <<<<<<<<<<<<<<
18188  *
18189  * @cname('__pyx_memoryview_err_dim')
18190  */
18191  __Pyx_TraceLine(1256,0,__PYX_ERR(2, 1256, __pyx_L1_error))
18192  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1256, __pyx_L1_error)
18193  __Pyx_GOTREF(__pyx_t_1);
18194  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1256, __pyx_L1_error)
18195  __Pyx_GOTREF(__pyx_t_2);
18196  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1256, __pyx_L1_error)
18197  __Pyx_GOTREF(__pyx_t_3);
18198  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1256, __pyx_L1_error)
18199  __Pyx_GOTREF(__pyx_t_4);
18200  __Pyx_GIVEREF(__pyx_t_1);
18201  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
18202  __Pyx_GIVEREF(__pyx_t_2);
18203  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
18204  __Pyx_GIVEREF(__pyx_t_3);
18205  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
18206  __pyx_t_1 = 0;
18207  __pyx_t_2 = 0;
18208  __pyx_t_3 = 0;
18209 
18210  /* "View.MemoryView":1255
18211  * cdef int _err_extents(int i, Py_ssize_t extent1,
18212  * Py_ssize_t extent2) except -1 with gil:
18213  * raise ValueError("got differing extents in dimension %d (got %d and %d)" % # <<<<<<<<<<<<<<
18214  * (i, extent1, extent2))
18215  *
18216  */
18217  __Pyx_TraceLine(1255,0,__PYX_ERR(2, 1255, __pyx_L1_error))
18218  __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1255, __pyx_L1_error)
18219  __Pyx_GOTREF(__pyx_t_3);
18220  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18221  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1255, __pyx_L1_error)
18222  __Pyx_GOTREF(__pyx_t_4);
18223  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18224  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
18225  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18226  __PYX_ERR(2, 1255, __pyx_L1_error)
18227 
18228  /* "View.MemoryView":1253
18229  *
18230  * @cname('__pyx_memoryview_err_extents')
18231  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
18232  * Py_ssize_t extent2) except -1 with gil:
18233  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
18234  */
18235 
18236  /* function exit code */
18237  __pyx_L1_error:;
18238  __Pyx_XDECREF(__pyx_t_1);
18239  __Pyx_XDECREF(__pyx_t_2);
18240  __Pyx_XDECREF(__pyx_t_3);
18241  __Pyx_XDECREF(__pyx_t_4);
18242  __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
18243  __pyx_r = -1;
18244  __Pyx_TraceReturn(Py_None, 0);
18245  __Pyx_RefNannyFinishContext();
18246  #ifdef WITH_THREAD
18247  __Pyx_PyGILState_Release(__pyx_gilstate_save);
18248  #endif
18249  return __pyx_r;
18250 }
18251 
18252 /* "View.MemoryView":1259
18253  *
18254  * @cname('__pyx_memoryview_err_dim')
18255  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
18256  * raise error(msg.decode('ascii') % dim)
18257  *
18258  */
18259 
18260 static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) {
18261  int __pyx_r;
18262  __Pyx_TraceDeclarations
18263  __Pyx_RefNannyDeclarations
18264  PyObject *__pyx_t_1 = NULL;
18265  PyObject *__pyx_t_2 = NULL;
18266  PyObject *__pyx_t_3 = NULL;
18267  PyObject *__pyx_t_4 = NULL;
18268  int __pyx_lineno = 0;
18269  const char *__pyx_filename = NULL;
18270  int __pyx_clineno = 0;
18271  #ifdef WITH_THREAD
18272  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18273  #endif
18274  __Pyx_RefNannySetupContext("_err_dim", 0);
18275  __Pyx_TraceCall("_err_dim", __pyx_f[2], 1259, 0, __PYX_ERR(2, 1259, __pyx_L1_error));
18276  __Pyx_INCREF(__pyx_v_error);
18277 
18278  /* "View.MemoryView":1260
18279  * @cname('__pyx_memoryview_err_dim')
18280  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:
18281  * raise error(msg.decode('ascii') % dim) # <<<<<<<<<<<<<<
18282  *
18283  * @cname('__pyx_memoryview_err')
18284  */
18285  __Pyx_TraceLine(1260,0,__PYX_ERR(2, 1260, __pyx_L1_error))
18286  __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1260, __pyx_L1_error)
18287  __Pyx_GOTREF(__pyx_t_2);
18288  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1260, __pyx_L1_error)
18289  __Pyx_GOTREF(__pyx_t_3);
18290  __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1260, __pyx_L1_error)
18291  __Pyx_GOTREF(__pyx_t_4);
18292  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18293  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18294  __Pyx_INCREF(__pyx_v_error);
18295  __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
18296  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
18297  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
18298  if (likely(__pyx_t_2)) {
18299  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
18300  __Pyx_INCREF(__pyx_t_2);
18301  __Pyx_INCREF(function);
18302  __Pyx_DECREF_SET(__pyx_t_3, function);
18303  }
18304  }
18305  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
18306  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
18307  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18308  if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1260, __pyx_L1_error)
18309  __Pyx_GOTREF(__pyx_t_1);
18310  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18311  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
18312  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18313  __PYX_ERR(2, 1260, __pyx_L1_error)
18314 
18315  /* "View.MemoryView":1259
18316  *
18317  * @cname('__pyx_memoryview_err_dim')
18318  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
18319  * raise error(msg.decode('ascii') % dim)
18320  *
18321  */
18322 
18323  /* function exit code */
18324  __pyx_L1_error:;
18325  __Pyx_XDECREF(__pyx_t_1);
18326  __Pyx_XDECREF(__pyx_t_2);
18327  __Pyx_XDECREF(__pyx_t_3);
18328  __Pyx_XDECREF(__pyx_t_4);
18329  __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
18330  __pyx_r = -1;
18331  __Pyx_XDECREF(__pyx_v_error);
18332  __Pyx_TraceReturn(Py_None, 0);
18333  __Pyx_RefNannyFinishContext();
18334  #ifdef WITH_THREAD
18335  __Pyx_PyGILState_Release(__pyx_gilstate_save);
18336  #endif
18337  return __pyx_r;
18338 }
18339 
18340 /* "View.MemoryView":1263
18341  *
18342  * @cname('__pyx_memoryview_err')
18343  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
18344  * if msg != NULL:
18345  * raise error(msg.decode('ascii'))
18346  */
18347 
18348 static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
18349  int __pyx_r;
18350  __Pyx_TraceDeclarations
18351  __Pyx_RefNannyDeclarations
18352  int __pyx_t_1;
18353  PyObject *__pyx_t_2 = NULL;
18354  PyObject *__pyx_t_3 = NULL;
18355  PyObject *__pyx_t_4 = NULL;
18356  PyObject *__pyx_t_5 = NULL;
18357  int __pyx_lineno = 0;
18358  const char *__pyx_filename = NULL;
18359  int __pyx_clineno = 0;
18360  #ifdef WITH_THREAD
18361  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18362  #endif
18363  __Pyx_RefNannySetupContext("_err", 0);
18364  __Pyx_TraceCall("_err", __pyx_f[2], 1263, 0, __PYX_ERR(2, 1263, __pyx_L1_error));
18365  __Pyx_INCREF(__pyx_v_error);
18366 
18367  /* "View.MemoryView":1264
18368  * @cname('__pyx_memoryview_err')
18369  * cdef int _err(object error, char *msg) except -1 with gil:
18370  * if msg != NULL: # <<<<<<<<<<<<<<
18371  * raise error(msg.decode('ascii'))
18372  * else:
18373  */
18374  __Pyx_TraceLine(1264,0,__PYX_ERR(2, 1264, __pyx_L1_error))
18375  __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
18376  if (unlikely(__pyx_t_1)) {
18377 
18378  /* "View.MemoryView":1265
18379  * cdef int _err(object error, char *msg) except -1 with gil:
18380  * if msg != NULL:
18381  * raise error(msg.decode('ascii')) # <<<<<<<<<<<<<<
18382  * else:
18383  * raise error
18384  */
18385  __Pyx_TraceLine(1265,0,__PYX_ERR(2, 1265, __pyx_L1_error))
18386  __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1265, __pyx_L1_error)
18387  __Pyx_GOTREF(__pyx_t_3);
18388  __Pyx_INCREF(__pyx_v_error);
18389  __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
18390  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
18391  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
18392  if (likely(__pyx_t_5)) {
18393  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
18394  __Pyx_INCREF(__pyx_t_5);
18395  __Pyx_INCREF(function);
18396  __Pyx_DECREF_SET(__pyx_t_4, function);
18397  }
18398  }
18399  __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
18400  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
18401  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18402  if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1265, __pyx_L1_error)
18403  __Pyx_GOTREF(__pyx_t_2);
18404  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18405  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
18406  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18407  __PYX_ERR(2, 1265, __pyx_L1_error)
18408 
18409  /* "View.MemoryView":1264
18410  * @cname('__pyx_memoryview_err')
18411  * cdef int _err(object error, char *msg) except -1 with gil:
18412  * if msg != NULL: # <<<<<<<<<<<<<<
18413  * raise error(msg.decode('ascii'))
18414  * else:
18415  */
18416  }
18417 
18418  /* "View.MemoryView":1267
18419  * raise error(msg.decode('ascii'))
18420  * else:
18421  * raise error # <<<<<<<<<<<<<<
18422  *
18423  * @cname('__pyx_memoryview_copy_contents')
18424  */
18425  __Pyx_TraceLine(1267,0,__PYX_ERR(2, 1267, __pyx_L1_error))
18426  /*else*/ {
18427  __Pyx_Raise(__pyx_v_error, 0, 0, 0);
18428  __PYX_ERR(2, 1267, __pyx_L1_error)
18429  }
18430 
18431  /* "View.MemoryView":1263
18432  *
18433  * @cname('__pyx_memoryview_err')
18434  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
18435  * if msg != NULL:
18436  * raise error(msg.decode('ascii'))
18437  */
18438 
18439  /* function exit code */
18440  __pyx_L1_error:;
18441  __Pyx_XDECREF(__pyx_t_2);
18442  __Pyx_XDECREF(__pyx_t_3);
18443  __Pyx_XDECREF(__pyx_t_4);
18444  __Pyx_XDECREF(__pyx_t_5);
18445  __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
18446  __pyx_r = -1;
18447  __Pyx_XDECREF(__pyx_v_error);
18448  __Pyx_TraceReturn(Py_None, 0);
18449  __Pyx_RefNannyFinishContext();
18450  #ifdef WITH_THREAD
18451  __Pyx_PyGILState_Release(__pyx_gilstate_save);
18452  #endif
18453  return __pyx_r;
18454 }
18455 
18456 /* "View.MemoryView":1270
18457  *
18458  * @cname('__pyx_memoryview_copy_contents')
18459  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
18460  * __Pyx_memviewslice dst,
18461  * int src_ndim, int dst_ndim,
18462  */
18463 
18464 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) {
18465  void *__pyx_v_tmpdata;
18466  size_t __pyx_v_itemsize;
18467  int __pyx_v_i;
18468  char __pyx_v_order;
18469  int __pyx_v_broadcasting;
18470  int __pyx_v_direct_copy;
18471  __Pyx_memviewslice __pyx_v_tmp;
18472  int __pyx_v_ndim;
18473  int __pyx_r;
18474  __Pyx_TraceDeclarations
18475  Py_ssize_t __pyx_t_1;
18476  int __pyx_t_2;
18477  int __pyx_t_3;
18478  int __pyx_t_4;
18479  int __pyx_t_5;
18480  int __pyx_t_6;
18481  void *__pyx_t_7;
18482  int __pyx_t_8;
18483  int __pyx_lineno = 0;
18484  const char *__pyx_filename = NULL;
18485  int __pyx_clineno = 0;
18486  __Pyx_TraceCall("memoryview_copy_contents", __pyx_f[2], 1270, 1, __PYX_ERR(2, 1270, __pyx_L1_error));
18487 
18488  /* "View.MemoryView":1278
18489  * Check for overlapping memory and verify the shapes.
18490  * """
18491  * cdef void *tmpdata = NULL # <<<<<<<<<<<<<<
18492  * cdef size_t itemsize = src.memview.view.itemsize
18493  * cdef int i
18494  */
18495  __Pyx_TraceLine(1278,1,__PYX_ERR(2, 1278, __pyx_L1_error))
18496  __pyx_v_tmpdata = NULL;
18497 
18498  /* "View.MemoryView":1279
18499  * """
18500  * cdef void *tmpdata = NULL
18501  * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
18502  * cdef int i
18503  * cdef char order = get_best_order(&src, src_ndim)
18504  */
18505  __Pyx_TraceLine(1279,1,__PYX_ERR(2, 1279, __pyx_L1_error))
18506  __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
18507  __pyx_v_itemsize = __pyx_t_1;
18508 
18509  /* "View.MemoryView":1281
18510  * cdef size_t itemsize = src.memview.view.itemsize
18511  * cdef int i
18512  * cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<<
18513  * cdef bint broadcasting = False
18514  * cdef bint direct_copy = False
18515  */
18516  __Pyx_TraceLine(1281,1,__PYX_ERR(2, 1281, __pyx_L1_error))
18517  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
18518 
18519  /* "View.MemoryView":1282
18520  * cdef int i
18521  * cdef char order = get_best_order(&src, src_ndim)
18522  * cdef bint broadcasting = False # <<<<<<<<<<<<<<
18523  * cdef bint direct_copy = False
18524  * cdef __Pyx_memviewslice tmp
18525  */
18526  __Pyx_TraceLine(1282,1,__PYX_ERR(2, 1282, __pyx_L1_error))
18527  __pyx_v_broadcasting = 0;
18528 
18529  /* "View.MemoryView":1283
18530  * cdef char order = get_best_order(&src, src_ndim)
18531  * cdef bint broadcasting = False
18532  * cdef bint direct_copy = False # <<<<<<<<<<<<<<
18533  * cdef __Pyx_memviewslice tmp
18534  *
18535  */
18536  __Pyx_TraceLine(1283,1,__PYX_ERR(2, 1283, __pyx_L1_error))
18537  __pyx_v_direct_copy = 0;
18538 
18539  /* "View.MemoryView":1286
18540  * cdef __Pyx_memviewslice tmp
18541  *
18542  * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
18543  * broadcast_leading(&src, src_ndim, dst_ndim)
18544  * elif dst_ndim < src_ndim:
18545  */
18546  __Pyx_TraceLine(1286,1,__PYX_ERR(2, 1286, __pyx_L1_error))
18547  __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
18548  if (__pyx_t_2) {
18549 
18550  /* "View.MemoryView":1287
18551  *
18552  * if src_ndim < dst_ndim:
18553  * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<<
18554  * elif dst_ndim < src_ndim:
18555  * broadcast_leading(&dst, dst_ndim, src_ndim)
18556  */
18557  __Pyx_TraceLine(1287,1,__PYX_ERR(2, 1287, __pyx_L1_error))
18558  __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
18559 
18560  /* "View.MemoryView":1286
18561  * cdef __Pyx_memviewslice tmp
18562  *
18563  * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
18564  * broadcast_leading(&src, src_ndim, dst_ndim)
18565  * elif dst_ndim < src_ndim:
18566  */
18567  goto __pyx_L3;
18568  }
18569 
18570  /* "View.MemoryView":1288
18571  * if src_ndim < dst_ndim:
18572  * broadcast_leading(&src, src_ndim, dst_ndim)
18573  * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
18574  * broadcast_leading(&dst, dst_ndim, src_ndim)
18575  *
18576  */
18577  __Pyx_TraceLine(1288,1,__PYX_ERR(2, 1288, __pyx_L1_error))
18578  __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
18579  if (__pyx_t_2) {
18580 
18581  /* "View.MemoryView":1289
18582  * broadcast_leading(&src, src_ndim, dst_ndim)
18583  * elif dst_ndim < src_ndim:
18584  * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<<
18585  *
18586  * cdef int ndim = max(src_ndim, dst_ndim)
18587  */
18588  __Pyx_TraceLine(1289,1,__PYX_ERR(2, 1289, __pyx_L1_error))
18589  __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
18590 
18591  /* "View.MemoryView":1288
18592  * if src_ndim < dst_ndim:
18593  * broadcast_leading(&src, src_ndim, dst_ndim)
18594  * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
18595  * broadcast_leading(&dst, dst_ndim, src_ndim)
18596  *
18597  */
18598  }
18599  __pyx_L3:;
18600 
18601  /* "View.MemoryView":1291
18602  * broadcast_leading(&dst, dst_ndim, src_ndim)
18603  *
18604  * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<<
18605  *
18606  * for i in range(ndim):
18607  */
18608  __Pyx_TraceLine(1291,1,__PYX_ERR(2, 1291, __pyx_L1_error))
18609  __pyx_t_3 = __pyx_v_dst_ndim;
18610  __pyx_t_4 = __pyx_v_src_ndim;
18611  if (((__pyx_t_3 > __pyx_t_4) != 0)) {
18612  __pyx_t_5 = __pyx_t_3;
18613  } else {
18614  __pyx_t_5 = __pyx_t_4;
18615  }
18616  __pyx_v_ndim = __pyx_t_5;
18617 
18618  /* "View.MemoryView":1293
18619  * cdef int ndim = max(src_ndim, dst_ndim)
18620  *
18621  * for i in range(ndim): # <<<<<<<<<<<<<<
18622  * if src.shape[i] != dst.shape[i]:
18623  * if src.shape[i] == 1:
18624  */
18625  __Pyx_TraceLine(1293,1,__PYX_ERR(2, 1293, __pyx_L1_error))
18626  __pyx_t_5 = __pyx_v_ndim;
18627  __pyx_t_3 = __pyx_t_5;
18628  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18629  __pyx_v_i = __pyx_t_4;
18630 
18631  /* "View.MemoryView":1294
18632  *
18633  * for i in range(ndim):
18634  * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
18635  * if src.shape[i] == 1:
18636  * broadcasting = True
18637  */
18638  __Pyx_TraceLine(1294,1,__PYX_ERR(2, 1294, __pyx_L1_error))
18639  __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
18640  if (__pyx_t_2) {
18641 
18642  /* "View.MemoryView":1295
18643  * for i in range(ndim):
18644  * if src.shape[i] != dst.shape[i]:
18645  * if src.shape[i] == 1: # <<<<<<<<<<<<<<
18646  * broadcasting = True
18647  * src.strides[i] = 0
18648  */
18649  __Pyx_TraceLine(1295,1,__PYX_ERR(2, 1295, __pyx_L1_error))
18650  __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
18651  if (__pyx_t_2) {
18652 
18653  /* "View.MemoryView":1296
18654  * if src.shape[i] != dst.shape[i]:
18655  * if src.shape[i] == 1:
18656  * broadcasting = True # <<<<<<<<<<<<<<
18657  * src.strides[i] = 0
18658  * else:
18659  */
18660  __Pyx_TraceLine(1296,1,__PYX_ERR(2, 1296, __pyx_L1_error))
18661  __pyx_v_broadcasting = 1;
18662 
18663  /* "View.MemoryView":1297
18664  * if src.shape[i] == 1:
18665  * broadcasting = True
18666  * src.strides[i] = 0 # <<<<<<<<<<<<<<
18667  * else:
18668  * _err_extents(i, dst.shape[i], src.shape[i])
18669  */
18670  __Pyx_TraceLine(1297,1,__PYX_ERR(2, 1297, __pyx_L1_error))
18671  (__pyx_v_src.strides[__pyx_v_i]) = 0;
18672 
18673  /* "View.MemoryView":1295
18674  * for i in range(ndim):
18675  * if src.shape[i] != dst.shape[i]:
18676  * if src.shape[i] == 1: # <<<<<<<<<<<<<<
18677  * broadcasting = True
18678  * src.strides[i] = 0
18679  */
18680  goto __pyx_L7;
18681  }
18682 
18683  /* "View.MemoryView":1299
18684  * src.strides[i] = 0
18685  * else:
18686  * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<<
18687  *
18688  * if src.suboffsets[i] >= 0:
18689  */
18690  __Pyx_TraceLine(1299,1,__PYX_ERR(2, 1299, __pyx_L1_error))
18691  /*else*/ {
18692  __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 1299, __pyx_L1_error)
18693  }
18694  __pyx_L7:;
18695 
18696  /* "View.MemoryView":1294
18697  *
18698  * for i in range(ndim):
18699  * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
18700  * if src.shape[i] == 1:
18701  * broadcasting = True
18702  */
18703  }
18704 
18705  /* "View.MemoryView":1301
18706  * _err_extents(i, dst.shape[i], src.shape[i])
18707  *
18708  * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
18709  * _err_dim(ValueError, "Dimension %d is not direct", i)
18710  *
18711  */
18712  __Pyx_TraceLine(1301,1,__PYX_ERR(2, 1301, __pyx_L1_error))
18713  __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
18714  if (__pyx_t_2) {
18715 
18716  /* "View.MemoryView":1302
18717  *
18718  * if src.suboffsets[i] >= 0:
18719  * _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<<
18720  *
18721  * if slices_overlap(&src, &dst, ndim, itemsize):
18722  */
18723  __Pyx_TraceLine(1302,1,__PYX_ERR(2, 1302, __pyx_L1_error))
18724  __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 1302, __pyx_L1_error)
18725 
18726  /* "View.MemoryView":1301
18727  * _err_extents(i, dst.shape[i], src.shape[i])
18728  *
18729  * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
18730  * _err_dim(ValueError, "Dimension %d is not direct", i)
18731  *
18732  */
18733  }
18734  }
18735 
18736  /* "View.MemoryView":1304
18737  * _err_dim(ValueError, "Dimension %d is not direct", i)
18738  *
18739  * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
18740  *
18741  * if not slice_is_contig(src, order, ndim):
18742  */
18743  __Pyx_TraceLine(1304,1,__PYX_ERR(2, 1304, __pyx_L1_error))
18744  __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
18745  if (__pyx_t_2) {
18746 
18747  /* "View.MemoryView":1306
18748  * if slices_overlap(&src, &dst, ndim, itemsize):
18749  *
18750  * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
18751  * order = get_best_order(&dst, ndim)
18752  *
18753  */
18754  __Pyx_TraceLine(1306,1,__PYX_ERR(2, 1306, __pyx_L1_error))
18755  __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
18756  if (__pyx_t_2) {
18757 
18758  /* "View.MemoryView":1307
18759  *
18760  * if not slice_is_contig(src, order, ndim):
18761  * order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<<
18762  *
18763  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
18764  */
18765  __Pyx_TraceLine(1307,1,__PYX_ERR(2, 1307, __pyx_L1_error))
18766  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
18767 
18768  /* "View.MemoryView":1306
18769  * if slices_overlap(&src, &dst, ndim, itemsize):
18770  *
18771  * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
18772  * order = get_best_order(&dst, ndim)
18773  *
18774  */
18775  }
18776 
18777  /* "View.MemoryView":1309
18778  * order = get_best_order(&dst, ndim)
18779  *
18780  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<<
18781  * src = tmp
18782  *
18783  */
18784  __Pyx_TraceLine(1309,1,__PYX_ERR(2, 1309, __pyx_L1_error))
18785  __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(2, 1309, __pyx_L1_error)
18786  __pyx_v_tmpdata = __pyx_t_7;
18787 
18788  /* "View.MemoryView":1310
18789  *
18790  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
18791  * src = tmp # <<<<<<<<<<<<<<
18792  *
18793  * if not broadcasting:
18794  */
18795  __Pyx_TraceLine(1310,1,__PYX_ERR(2, 1310, __pyx_L1_error))
18796  __pyx_v_src = __pyx_v_tmp;
18797 
18798  /* "View.MemoryView":1304
18799  * _err_dim(ValueError, "Dimension %d is not direct", i)
18800  *
18801  * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
18802  *
18803  * if not slice_is_contig(src, order, ndim):
18804  */
18805  }
18806 
18807  /* "View.MemoryView":1312
18808  * src = tmp
18809  *
18810  * if not broadcasting: # <<<<<<<<<<<<<<
18811  *
18812  *
18813  */
18814  __Pyx_TraceLine(1312,1,__PYX_ERR(2, 1312, __pyx_L1_error))
18815  __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
18816  if (__pyx_t_2) {
18817 
18818  /* "View.MemoryView":1315
18819  *
18820  *
18821  * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
18822  * direct_copy = slice_is_contig(dst, 'C', ndim)
18823  * elif slice_is_contig(src, 'F', ndim):
18824  */
18825  __Pyx_TraceLine(1315,1,__PYX_ERR(2, 1315, __pyx_L1_error))
18826  __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0);
18827  if (__pyx_t_2) {
18828 
18829  /* "View.MemoryView":1316
18830  *
18831  * if slice_is_contig(src, 'C', ndim):
18832  * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<<
18833  * elif slice_is_contig(src, 'F', ndim):
18834  * direct_copy = slice_is_contig(dst, 'F', ndim)
18835  */
18836  __Pyx_TraceLine(1316,1,__PYX_ERR(2, 1316, __pyx_L1_error))
18837  __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim);
18838 
18839  /* "View.MemoryView":1315
18840  *
18841  *
18842  * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
18843  * direct_copy = slice_is_contig(dst, 'C', ndim)
18844  * elif slice_is_contig(src, 'F', ndim):
18845  */
18846  goto __pyx_L12;
18847  }
18848 
18849  /* "View.MemoryView":1317
18850  * if slice_is_contig(src, 'C', ndim):
18851  * direct_copy = slice_is_contig(dst, 'C', ndim)
18852  * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
18853  * direct_copy = slice_is_contig(dst, 'F', ndim)
18854  *
18855  */
18856  __Pyx_TraceLine(1317,1,__PYX_ERR(2, 1317, __pyx_L1_error))
18857  __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0);
18858  if (__pyx_t_2) {
18859 
18860  /* "View.MemoryView":1318
18861  * direct_copy = slice_is_contig(dst, 'C', ndim)
18862  * elif slice_is_contig(src, 'F', ndim):
18863  * direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<<
18864  *
18865  * if direct_copy:
18866  */
18867  __Pyx_TraceLine(1318,1,__PYX_ERR(2, 1318, __pyx_L1_error))
18868  __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
18869 
18870  /* "View.MemoryView":1317
18871  * if slice_is_contig(src, 'C', ndim):
18872  * direct_copy = slice_is_contig(dst, 'C', ndim)
18873  * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
18874  * direct_copy = slice_is_contig(dst, 'F', ndim)
18875  *
18876  */
18877  }
18878  __pyx_L12:;
18879 
18880  /* "View.MemoryView":1320
18881  * direct_copy = slice_is_contig(dst, 'F', ndim)
18882  *
18883  * if direct_copy: # <<<<<<<<<<<<<<
18884  *
18885  * refcount_copying(&dst, dtype_is_object, ndim, False)
18886  */
18887  __Pyx_TraceLine(1320,1,__PYX_ERR(2, 1320, __pyx_L1_error))
18888  __pyx_t_2 = (__pyx_v_direct_copy != 0);
18889  if (__pyx_t_2) {
18890 
18891  /* "View.MemoryView":1322
18892  * if direct_copy:
18893  *
18894  * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
18895  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
18896  * refcount_copying(&dst, dtype_is_object, ndim, True)
18897  */
18898  __Pyx_TraceLine(1322,1,__PYX_ERR(2, 1322, __pyx_L1_error))
18899  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
18900 
18901  /* "View.MemoryView":1323
18902  *
18903  * refcount_copying(&dst, dtype_is_object, ndim, False)
18904  * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<<
18905  * refcount_copying(&dst, dtype_is_object, ndim, True)
18906  * free(tmpdata)
18907  */
18908  __Pyx_TraceLine(1323,1,__PYX_ERR(2, 1323, __pyx_L1_error))
18909  (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
18910 
18911  /* "View.MemoryView":1324
18912  * refcount_copying(&dst, dtype_is_object, ndim, False)
18913  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
18914  * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
18915  * free(tmpdata)
18916  * return 0
18917  */
18918  __Pyx_TraceLine(1324,1,__PYX_ERR(2, 1324, __pyx_L1_error))
18919  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
18920 
18921  /* "View.MemoryView":1325
18922  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
18923  * refcount_copying(&dst, dtype_is_object, ndim, True)
18924  * free(tmpdata) # <<<<<<<<<<<<<<
18925  * return 0
18926  *
18927  */
18928  __Pyx_TraceLine(1325,1,__PYX_ERR(2, 1325, __pyx_L1_error))
18929  free(__pyx_v_tmpdata);
18930 
18931  /* "View.MemoryView":1326
18932  * refcount_copying(&dst, dtype_is_object, ndim, True)
18933  * free(tmpdata)
18934  * return 0 # <<<<<<<<<<<<<<
18935  *
18936  * if order == 'F' == get_best_order(&dst, ndim):
18937  */
18938  __Pyx_TraceLine(1326,1,__PYX_ERR(2, 1326, __pyx_L1_error))
18939  __pyx_r = 0;
18940  goto __pyx_L0;
18941 
18942  /* "View.MemoryView":1320
18943  * direct_copy = slice_is_contig(dst, 'F', ndim)
18944  *
18945  * if direct_copy: # <<<<<<<<<<<<<<
18946  *
18947  * refcount_copying(&dst, dtype_is_object, ndim, False)
18948  */
18949  }
18950 
18951  /* "View.MemoryView":1312
18952  * src = tmp
18953  *
18954  * if not broadcasting: # <<<<<<<<<<<<<<
18955  *
18956  *
18957  */
18958  }
18959 
18960  /* "View.MemoryView":1328
18961  * return 0
18962  *
18963  * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
18964  *
18965  *
18966  */
18967  __Pyx_TraceLine(1328,1,__PYX_ERR(2, 1328, __pyx_L1_error))
18968  __pyx_t_2 = (__pyx_v_order == 'F');
18969  if (__pyx_t_2) {
18970  __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
18971  }
18972  __pyx_t_8 = (__pyx_t_2 != 0);
18973  if (__pyx_t_8) {
18974 
18975  /* "View.MemoryView":1331
18976  *
18977  *
18978  * transpose_memslice(&src) # <<<<<<<<<<<<<<
18979  * transpose_memslice(&dst)
18980  *
18981  */
18982  __Pyx_TraceLine(1331,1,__PYX_ERR(2, 1331, __pyx_L1_error))
18983  __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(2, 1331, __pyx_L1_error)
18984 
18985  /* "View.MemoryView":1332
18986  *
18987  * transpose_memslice(&src)
18988  * transpose_memslice(&dst) # <<<<<<<<<<<<<<
18989  *
18990  * refcount_copying(&dst, dtype_is_object, ndim, False)
18991  */
18992  __Pyx_TraceLine(1332,1,__PYX_ERR(2, 1332, __pyx_L1_error))
18993  __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(2, 1332, __pyx_L1_error)
18994 
18995  /* "View.MemoryView":1328
18996  * return 0
18997  *
18998  * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
18999  *
19000  *
19001  */
19002  }
19003 
19004  /* "View.MemoryView":1334
19005  * transpose_memslice(&dst)
19006  *
19007  * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
19008  * copy_strided_to_strided(&src, &dst, ndim, itemsize)
19009  * refcount_copying(&dst, dtype_is_object, ndim, True)
19010  */
19011  __Pyx_TraceLine(1334,1,__PYX_ERR(2, 1334, __pyx_L1_error))
19012  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
19013 
19014  /* "View.MemoryView":1335
19015  *
19016  * refcount_copying(&dst, dtype_is_object, ndim, False)
19017  * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<<
19018  * refcount_copying(&dst, dtype_is_object, ndim, True)
19019  *
19020  */
19021  __Pyx_TraceLine(1335,1,__PYX_ERR(2, 1335, __pyx_L1_error))
19022  copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
19023 
19024  /* "View.MemoryView":1336
19025  * refcount_copying(&dst, dtype_is_object, ndim, False)
19026  * copy_strided_to_strided(&src, &dst, ndim, itemsize)
19027  * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
19028  *
19029  * free(tmpdata)
19030  */
19031  __Pyx_TraceLine(1336,1,__PYX_ERR(2, 1336, __pyx_L1_error))
19032  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
19033 
19034  /* "View.MemoryView":1338
19035  * refcount_copying(&dst, dtype_is_object, ndim, True)
19036  *
19037  * free(tmpdata) # <<<<<<<<<<<<<<
19038  * return 0
19039  *
19040  */
19041  __Pyx_TraceLine(1338,1,__PYX_ERR(2, 1338, __pyx_L1_error))
19042  free(__pyx_v_tmpdata);
19043 
19044  /* "View.MemoryView":1339
19045  *
19046  * free(tmpdata)
19047  * return 0 # <<<<<<<<<<<<<<
19048  *
19049  * @cname('__pyx_memoryview_broadcast_leading')
19050  */
19051  __Pyx_TraceLine(1339,1,__PYX_ERR(2, 1339, __pyx_L1_error))
19052  __pyx_r = 0;
19053  goto __pyx_L0;
19054 
19055  /* "View.MemoryView":1270
19056  *
19057  * @cname('__pyx_memoryview_copy_contents')
19058  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
19059  * __Pyx_memviewslice dst,
19060  * int src_ndim, int dst_ndim,
19061  */
19062 
19063  /* function exit code */
19064  __pyx_L1_error:;
19065  {
19066  #ifdef WITH_THREAD
19067  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19068  #endif
19069  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
19070  #ifdef WITH_THREAD
19071  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19072  #endif
19073  }
19074  __pyx_r = -1;
19075  __pyx_L0:;
19076  __Pyx_TraceReturn(Py_None, 1);
19077  return __pyx_r;
19078 }
19079 
19080 /* "View.MemoryView":1342
19081  *
19082  * @cname('__pyx_memoryview_broadcast_leading')
19083  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
19084  * int ndim,
19085  * int ndim_other) nogil:
19086  */
19087 
19088 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
19089  int __pyx_v_i;
19090  int __pyx_v_offset;
19091  __Pyx_TraceDeclarations
19092  int __pyx_t_1;
19093  int __pyx_t_2;
19094  int __pyx_t_3;
19095  int __pyx_lineno = 0;
19096  const char *__pyx_filename = NULL;
19097  int __pyx_clineno = 0;
19098  __Pyx_TraceCall("broadcast_leading", __pyx_f[2], 1342, 1, __PYX_ERR(2, 1342, __pyx_L1_error));
19099 
19100  /* "View.MemoryView":1346
19101  * int ndim_other) nogil:
19102  * cdef int i
19103  * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<<
19104  *
19105  * for i in range(ndim - 1, -1, -1):
19106  */
19107  __Pyx_TraceLine(1346,1,__PYX_ERR(2, 1346, __pyx_L1_error))
19108  __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
19109 
19110  /* "View.MemoryView":1348
19111  * cdef int offset = ndim_other - ndim
19112  *
19113  * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
19114  * mslice.shape[i + offset] = mslice.shape[i]
19115  * mslice.strides[i + offset] = mslice.strides[i]
19116  */
19117  __Pyx_TraceLine(1348,1,__PYX_ERR(2, 1348, __pyx_L1_error))
19118  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
19119  __pyx_v_i = __pyx_t_1;
19120 
19121  /* "View.MemoryView":1349
19122  *
19123  * for i in range(ndim - 1, -1, -1):
19124  * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<<
19125  * mslice.strides[i + offset] = mslice.strides[i]
19126  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
19127  */
19128  __Pyx_TraceLine(1349,1,__PYX_ERR(2, 1349, __pyx_L1_error))
19129  (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
19130 
19131  /* "View.MemoryView":1350
19132  * for i in range(ndim - 1, -1, -1):
19133  * mslice.shape[i + offset] = mslice.shape[i]
19134  * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<<
19135  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
19136  *
19137  */
19138  __Pyx_TraceLine(1350,1,__PYX_ERR(2, 1350, __pyx_L1_error))
19139  (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
19140 
19141  /* "View.MemoryView":1351
19142  * mslice.shape[i + offset] = mslice.shape[i]
19143  * mslice.strides[i + offset] = mslice.strides[i]
19144  * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<<
19145  *
19146  * for i in range(offset):
19147  */
19148  __Pyx_TraceLine(1351,1,__PYX_ERR(2, 1351, __pyx_L1_error))
19149  (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
19150  }
19151 
19152  /* "View.MemoryView":1353
19153  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
19154  *
19155  * for i in range(offset): # <<<<<<<<<<<<<<
19156  * mslice.shape[i] = 1
19157  * mslice.strides[i] = mslice.strides[0]
19158  */
19159  __Pyx_TraceLine(1353,1,__PYX_ERR(2, 1353, __pyx_L1_error))
19160  __pyx_t_1 = __pyx_v_offset;
19161  __pyx_t_2 = __pyx_t_1;
19162  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
19163  __pyx_v_i = __pyx_t_3;
19164 
19165  /* "View.MemoryView":1354
19166  *
19167  * for i in range(offset):
19168  * mslice.shape[i] = 1 # <<<<<<<<<<<<<<
19169  * mslice.strides[i] = mslice.strides[0]
19170  * mslice.suboffsets[i] = -1
19171  */
19172  __Pyx_TraceLine(1354,1,__PYX_ERR(2, 1354, __pyx_L1_error))
19173  (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
19174 
19175  /* "View.MemoryView":1355
19176  * for i in range(offset):
19177  * mslice.shape[i] = 1
19178  * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<<
19179  * mslice.suboffsets[i] = -1
19180  *
19181  */
19182  __Pyx_TraceLine(1355,1,__PYX_ERR(2, 1355, __pyx_L1_error))
19183  (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
19184 
19185  /* "View.MemoryView":1356
19186  * mslice.shape[i] = 1
19187  * mslice.strides[i] = mslice.strides[0]
19188  * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
19189  *
19190  *
19191  */
19192  __Pyx_TraceLine(1356,1,__PYX_ERR(2, 1356, __pyx_L1_error))
19193  (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
19194  }
19195 
19196  /* "View.MemoryView":1342
19197  *
19198  * @cname('__pyx_memoryview_broadcast_leading')
19199  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
19200  * int ndim,
19201  * int ndim_other) nogil:
19202  */
19203 
19204  /* function exit code */
19205  goto __pyx_L0;
19206  __pyx_L1_error:;
19207  __Pyx_WriteUnraisable("View.MemoryView.broadcast_leading", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
19208  __pyx_L0:;
19209  __Pyx_TraceReturn(Py_None, 1);
19210 }
19211 
19212 /* "View.MemoryView":1364
19213  *
19214  * @cname('__pyx_memoryview_refcount_copying')
19215  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
19216  * int ndim, bint inc) nogil:
19217  *
19218  */
19219 
19220 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) {
19221  __Pyx_TraceDeclarations
19222  int __pyx_t_1;
19223  int __pyx_lineno = 0;
19224  const char *__pyx_filename = NULL;
19225  int __pyx_clineno = 0;
19226  __Pyx_TraceCall("refcount_copying", __pyx_f[2], 1364, 1, __PYX_ERR(2, 1364, __pyx_L1_error));
19227 
19228  /* "View.MemoryView":1368
19229  *
19230  *
19231  * if dtype_is_object: # <<<<<<<<<<<<<<
19232  * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
19233  * dst.strides, ndim, inc)
19234  */
19235  __Pyx_TraceLine(1368,1,__PYX_ERR(2, 1368, __pyx_L1_error))
19236  __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
19237  if (__pyx_t_1) {
19238 
19239  /* "View.MemoryView":1369
19240  *
19241  * if dtype_is_object:
19242  * refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<<
19243  * dst.strides, ndim, inc)
19244  *
19245  */
19246  __Pyx_TraceLine(1369,1,__PYX_ERR(2, 1369, __pyx_L1_error))
19247  __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
19248 
19249  /* "View.MemoryView":1368
19250  *
19251  *
19252  * if dtype_is_object: # <<<<<<<<<<<<<<
19253  * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
19254  * dst.strides, ndim, inc)
19255  */
19256  }
19257 
19258  /* "View.MemoryView":1364
19259  *
19260  * @cname('__pyx_memoryview_refcount_copying')
19261  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
19262  * int ndim, bint inc) nogil:
19263  *
19264  */
19265 
19266  /* function exit code */
19267  goto __pyx_L0;
19268  __pyx_L1_error:;
19269  __Pyx_WriteUnraisable("View.MemoryView.refcount_copying", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
19270  __pyx_L0:;
19271  __Pyx_TraceReturn(Py_None, 1);
19272 }
19273 
19274 /* "View.MemoryView":1373
19275  *
19276  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
19277  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
19278  * Py_ssize_t *strides, int ndim,
19279  * bint inc) with gil:
19280  */
19281 
19282 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
19283  __Pyx_TraceDeclarations
19284  __Pyx_RefNannyDeclarations
19285  int __pyx_lineno = 0;
19286  const char *__pyx_filename = NULL;
19287  int __pyx_clineno = 0;
19288  #ifdef WITH_THREAD
19289  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19290  #endif
19291  __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0);
19292  __Pyx_TraceCall("refcount_objects_in_slice_with_gil", __pyx_f[2], 1373, 0, __PYX_ERR(2, 1373, __pyx_L1_error));
19293 
19294  /* "View.MemoryView":1376
19295  * Py_ssize_t *strides, int ndim,
19296  * bint inc) with gil:
19297  * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<<
19298  *
19299  * @cname('__pyx_memoryview_refcount_objects_in_slice')
19300  */
19301  __Pyx_TraceLine(1376,0,__PYX_ERR(2, 1376, __pyx_L1_error))
19302  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
19303 
19304  /* "View.MemoryView":1373
19305  *
19306  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
19307  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
19308  * Py_ssize_t *strides, int ndim,
19309  * bint inc) with gil:
19310  */
19311 
19312  /* function exit code */
19313  goto __pyx_L0;
19314  __pyx_L1_error:;
19315  __Pyx_WriteUnraisable("View.MemoryView.refcount_objects_in_slice_with_gil", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
19316  __pyx_L0:;
19317  __Pyx_TraceReturn(Py_None, 0);
19318  __Pyx_RefNannyFinishContext();
19319  #ifdef WITH_THREAD
19320  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19321  #endif
19322 }
19323 
19324 /* "View.MemoryView":1379
19325  *
19326  * @cname('__pyx_memoryview_refcount_objects_in_slice')
19327  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
19328  * Py_ssize_t *strides, int ndim, bint inc):
19329  * cdef Py_ssize_t i
19330  */
19331 
19332 static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
19333  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
19334  __Pyx_TraceDeclarations
19335  __Pyx_RefNannyDeclarations
19336  Py_ssize_t __pyx_t_1;
19337  Py_ssize_t __pyx_t_2;
19338  Py_ssize_t __pyx_t_3;
19339  int __pyx_t_4;
19340  int __pyx_lineno = 0;
19341  const char *__pyx_filename = NULL;
19342  int __pyx_clineno = 0;
19343  __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0);
19344  __Pyx_TraceCall("refcount_objects_in_slice", __pyx_f[2], 1379, 0, __PYX_ERR(2, 1379, __pyx_L1_error));
19345 
19346  /* "View.MemoryView":1383
19347  * cdef Py_ssize_t i
19348  *
19349  * for i in range(shape[0]): # <<<<<<<<<<<<<<
19350  * if ndim == 1:
19351  * if inc:
19352  */
19353  __Pyx_TraceLine(1383,0,__PYX_ERR(2, 1383, __pyx_L1_error))
19354  __pyx_t_1 = (__pyx_v_shape[0]);
19355  __pyx_t_2 = __pyx_t_1;
19356  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
19357  __pyx_v_i = __pyx_t_3;
19358 
19359  /* "View.MemoryView":1384
19360  *
19361  * for i in range(shape[0]):
19362  * if ndim == 1: # <<<<<<<<<<<<<<
19363  * if inc:
19364  * Py_INCREF((<PyObject **> data)[0])
19365  */
19366  __Pyx_TraceLine(1384,0,__PYX_ERR(2, 1384, __pyx_L1_error))
19367  __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
19368  if (__pyx_t_4) {
19369 
19370  /* "View.MemoryView":1385
19371  * for i in range(shape[0]):
19372  * if ndim == 1:
19373  * if inc: # <<<<<<<<<<<<<<
19374  * Py_INCREF((<PyObject **> data)[0])
19375  * else:
19376  */
19377  __Pyx_TraceLine(1385,0,__PYX_ERR(2, 1385, __pyx_L1_error))
19378  __pyx_t_4 = (__pyx_v_inc != 0);
19379  if (__pyx_t_4) {
19380 
19381  /* "View.MemoryView":1386
19382  * if ndim == 1:
19383  * if inc:
19384  * Py_INCREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
19385  * else:
19386  * Py_DECREF((<PyObject **> data)[0])
19387  */
19388  __Pyx_TraceLine(1386,0,__PYX_ERR(2, 1386, __pyx_L1_error))
19389  Py_INCREF((((PyObject **)__pyx_v_data)[0]));
19390 
19391  /* "View.MemoryView":1385
19392  * for i in range(shape[0]):
19393  * if ndim == 1:
19394  * if inc: # <<<<<<<<<<<<<<
19395  * Py_INCREF((<PyObject **> data)[0])
19396  * else:
19397  */
19398  goto __pyx_L6;
19399  }
19400 
19401  /* "View.MemoryView":1388
19402  * Py_INCREF((<PyObject **> data)[0])
19403  * else:
19404  * Py_DECREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
19405  * else:
19406  * refcount_objects_in_slice(data, shape + 1, strides + 1,
19407  */
19408  __Pyx_TraceLine(1388,0,__PYX_ERR(2, 1388, __pyx_L1_error))
19409  /*else*/ {
19410  Py_DECREF((((PyObject **)__pyx_v_data)[0]));
19411  }
19412  __pyx_L6:;
19413 
19414  /* "View.MemoryView":1384
19415  *
19416  * for i in range(shape[0]):
19417  * if ndim == 1: # <<<<<<<<<<<<<<
19418  * if inc:
19419  * Py_INCREF((<PyObject **> data)[0])
19420  */
19421  goto __pyx_L5;
19422  }
19423 
19424  /* "View.MemoryView":1390
19425  * Py_DECREF((<PyObject **> data)[0])
19426  * else:
19427  * refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
19428  * ndim - 1, inc)
19429  *
19430  */
19431  __Pyx_TraceLine(1390,0,__PYX_ERR(2, 1390, __pyx_L1_error))
19432  /*else*/ {
19433 
19434  /* "View.MemoryView":1391
19435  * else:
19436  * refcount_objects_in_slice(data, shape + 1, strides + 1,
19437  * ndim - 1, inc) # <<<<<<<<<<<<<<
19438  *
19439  * data += strides[0]
19440  */
19441  __Pyx_TraceLine(1391,0,__PYX_ERR(2, 1391, __pyx_L1_error))
19442  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
19443  }
19444  __pyx_L5:;
19445 
19446  /* "View.MemoryView":1393
19447  * ndim - 1, inc)
19448  *
19449  * data += strides[0] # <<<<<<<<<<<<<<
19450  *
19451  *
19452  */
19453  __Pyx_TraceLine(1393,0,__PYX_ERR(2, 1393, __pyx_L1_error))
19454  __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
19455  }
19456 
19457  /* "View.MemoryView":1379
19458  *
19459  * @cname('__pyx_memoryview_refcount_objects_in_slice')
19460  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
19461  * Py_ssize_t *strides, int ndim, bint inc):
19462  * cdef Py_ssize_t i
19463  */
19464 
19465  /* function exit code */
19466  goto __pyx_L0;
19467  __pyx_L1_error:;
19468  __Pyx_WriteUnraisable("View.MemoryView.refcount_objects_in_slice", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
19469  __pyx_L0:;
19470  __Pyx_TraceReturn(Py_None, 0);
19471  __Pyx_RefNannyFinishContext();
19472 }
19473 
19474 /* "View.MemoryView":1399
19475  *
19476  * @cname('__pyx_memoryview_slice_assign_scalar')
19477  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
19478  * size_t itemsize, void *item,
19479  * bint dtype_is_object) nogil:
19480  */
19481 
19482 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) {
19483  __Pyx_TraceDeclarations
19484  int __pyx_lineno = 0;
19485  const char *__pyx_filename = NULL;
19486  int __pyx_clineno = 0;
19487  __Pyx_TraceCall("slice_assign_scalar", __pyx_f[2], 1399, 1, __PYX_ERR(2, 1399, __pyx_L1_error));
19488 
19489  /* "View.MemoryView":1402
19490  * size_t itemsize, void *item,
19491  * bint dtype_is_object) nogil:
19492  * refcount_copying(dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
19493  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
19494  * itemsize, item)
19495  */
19496  __Pyx_TraceLine(1402,1,__PYX_ERR(2, 1402, __pyx_L1_error))
19497  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
19498 
19499  /* "View.MemoryView":1403
19500  * bint dtype_is_object) nogil:
19501  * refcount_copying(dst, dtype_is_object, ndim, False)
19502  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, # <<<<<<<<<<<<<<
19503  * itemsize, item)
19504  * refcount_copying(dst, dtype_is_object, ndim, True)
19505  */
19506  __Pyx_TraceLine(1403,1,__PYX_ERR(2, 1403, __pyx_L1_error))
19507  __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);
19508 
19509  /* "View.MemoryView":1405
19510  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
19511  * itemsize, item)
19512  * refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
19513  *
19514  *
19515  */
19516  __Pyx_TraceLine(1405,1,__PYX_ERR(2, 1405, __pyx_L1_error))
19517  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
19518 
19519  /* "View.MemoryView":1399
19520  *
19521  * @cname('__pyx_memoryview_slice_assign_scalar')
19522  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
19523  * size_t itemsize, void *item,
19524  * bint dtype_is_object) nogil:
19525  */
19526 
19527  /* function exit code */
19528  goto __pyx_L0;
19529  __pyx_L1_error:;
19530  __Pyx_WriteUnraisable("View.MemoryView.slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
19531  __pyx_L0:;
19532  __Pyx_TraceReturn(Py_None, 1);
19533 }
19534 
19535 /* "View.MemoryView":1409
19536  *
19537  * @cname('__pyx_memoryview__slice_assign_scalar')
19538  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
19539  * Py_ssize_t *strides, int ndim,
19540  * size_t itemsize, void *item) nogil:
19541  */
19542 
19543 static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) {
19544  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
19545  Py_ssize_t __pyx_v_stride;
19546  Py_ssize_t __pyx_v_extent;
19547  __Pyx_TraceDeclarations
19548  int __pyx_t_1;
19549  Py_ssize_t __pyx_t_2;
19550  Py_ssize_t __pyx_t_3;
19551  Py_ssize_t __pyx_t_4;
19552  int __pyx_lineno = 0;
19553  const char *__pyx_filename = NULL;
19554  int __pyx_clineno = 0;
19555  __Pyx_TraceCall("_slice_assign_scalar", __pyx_f[2], 1409, 1, __PYX_ERR(2, 1409, __pyx_L1_error));
19556 
19557  /* "View.MemoryView":1413
19558  * size_t itemsize, void *item) nogil:
19559  * cdef Py_ssize_t i
19560  * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
19561  * cdef Py_ssize_t extent = shape[0]
19562  *
19563  */
19564  __Pyx_TraceLine(1413,1,__PYX_ERR(2, 1413, __pyx_L1_error))
19565  __pyx_v_stride = (__pyx_v_strides[0]);
19566 
19567  /* "View.MemoryView":1414
19568  * cdef Py_ssize_t i
19569  * cdef Py_ssize_t stride = strides[0]
19570  * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<<
19571  *
19572  * if ndim == 1:
19573  */
19574  __Pyx_TraceLine(1414,1,__PYX_ERR(2, 1414, __pyx_L1_error))
19575  __pyx_v_extent = (__pyx_v_shape[0]);
19576 
19577  /* "View.MemoryView":1416
19578  * cdef Py_ssize_t extent = shape[0]
19579  *
19580  * if ndim == 1: # <<<<<<<<<<<<<<
19581  * for i in range(extent):
19582  * memcpy(data, item, itemsize)
19583  */
19584  __Pyx_TraceLine(1416,1,__PYX_ERR(2, 1416, __pyx_L1_error))
19585  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
19586  if (__pyx_t_1) {
19587 
19588  /* "View.MemoryView":1417
19589  *
19590  * if ndim == 1:
19591  * for i in range(extent): # <<<<<<<<<<<<<<
19592  * memcpy(data, item, itemsize)
19593  * data += stride
19594  */
19595  __Pyx_TraceLine(1417,1,__PYX_ERR(2, 1417, __pyx_L1_error))
19596  __pyx_t_2 = __pyx_v_extent;
19597  __pyx_t_3 = __pyx_t_2;
19598  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19599  __pyx_v_i = __pyx_t_4;
19600 
19601  /* "View.MemoryView":1418
19602  * if ndim == 1:
19603  * for i in range(extent):
19604  * memcpy(data, item, itemsize) # <<<<<<<<<<<<<<
19605  * data += stride
19606  * else:
19607  */
19608  __Pyx_TraceLine(1418,1,__PYX_ERR(2, 1418, __pyx_L1_error))
19609  (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
19610 
19611  /* "View.MemoryView":1419
19612  * for i in range(extent):
19613  * memcpy(data, item, itemsize)
19614  * data += stride # <<<<<<<<<<<<<<
19615  * else:
19616  * for i in range(extent):
19617  */
19618  __Pyx_TraceLine(1419,1,__PYX_ERR(2, 1419, __pyx_L1_error))
19619  __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
19620  }
19621 
19622  /* "View.MemoryView":1416
19623  * cdef Py_ssize_t extent = shape[0]
19624  *
19625  * if ndim == 1: # <<<<<<<<<<<<<<
19626  * for i in range(extent):
19627  * memcpy(data, item, itemsize)
19628  */
19629  goto __pyx_L3;
19630  }
19631 
19632  /* "View.MemoryView":1421
19633  * data += stride
19634  * else:
19635  * for i in range(extent): # <<<<<<<<<<<<<<
19636  * _slice_assign_scalar(data, shape + 1, strides + 1,
19637  * ndim - 1, itemsize, item)
19638  */
19639  __Pyx_TraceLine(1421,1,__PYX_ERR(2, 1421, __pyx_L1_error))
19640  /*else*/ {
19641  __pyx_t_2 = __pyx_v_extent;
19642  __pyx_t_3 = __pyx_t_2;
19643  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19644  __pyx_v_i = __pyx_t_4;
19645 
19646  /* "View.MemoryView":1422
19647  * else:
19648  * for i in range(extent):
19649  * _slice_assign_scalar(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
19650  * ndim - 1, itemsize, item)
19651  * data += stride
19652  */
19653  __Pyx_TraceLine(1422,1,__PYX_ERR(2, 1422, __pyx_L1_error))
19654  __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);
19655 
19656  /* "View.MemoryView":1424
19657  * _slice_assign_scalar(data, shape + 1, strides + 1,
19658  * ndim - 1, itemsize, item)
19659  * data += stride # <<<<<<<<<<<<<<
19660  *
19661  *
19662  */
19663  __Pyx_TraceLine(1424,1,__PYX_ERR(2, 1424, __pyx_L1_error))
19664  __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
19665  }
19666  }
19667  __pyx_L3:;
19668 
19669  /* "View.MemoryView":1409
19670  *
19671  * @cname('__pyx_memoryview__slice_assign_scalar')
19672  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
19673  * Py_ssize_t *strides, int ndim,
19674  * size_t itemsize, void *item) nogil:
19675  */
19676 
19677  /* function exit code */
19678  goto __pyx_L0;
19679  __pyx_L1_error:;
19680  __Pyx_WriteUnraisable("View.MemoryView._slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
19681  __pyx_L0:;
19682  __Pyx_TraceReturn(Py_None, 1);
19683 }
19684 
19685 /* "(tree fragment)":1
19686  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
19687  * cdef object __pyx_PickleError
19688  * cdef object __pyx_result
19689  */
19690 
19691 /* Python wrapper */
19692 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
19693 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {"__pyx_unpickle_Enum", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, METH_VARARGS|METH_KEYWORDS, 0};
19694 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
19695  PyObject *__pyx_v___pyx_type = 0;
19696  long __pyx_v___pyx_checksum;
19697  PyObject *__pyx_v___pyx_state = 0;
19698  int __pyx_lineno = 0;
19699  const char *__pyx_filename = NULL;
19700  int __pyx_clineno = 0;
19701  PyObject *__pyx_r = 0;
19702  __Pyx_RefNannyDeclarations
19703  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0);
19704  {
19705  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
19706  PyObject* values[3] = {0,0,0};
19707  if (unlikely(__pyx_kwds)) {
19708  Py_ssize_t kw_args;
19709  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
19710  switch (pos_args) {
19711  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
19712  CYTHON_FALLTHROUGH;
19713  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
19714  CYTHON_FALLTHROUGH;
19715  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
19716  CYTHON_FALLTHROUGH;
19717  case 0: break;
19718  default: goto __pyx_L5_argtuple_error;
19719  }
19720  kw_args = PyDict_Size(__pyx_kwds);
19721  switch (pos_args) {
19722  case 0:
19723  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
19724  else goto __pyx_L5_argtuple_error;
19725  CYTHON_FALLTHROUGH;
19726  case 1:
19727  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
19728  else {
19729  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(2, 1, __pyx_L3_error)
19730  }
19731  CYTHON_FALLTHROUGH;
19732  case 2:
19733  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
19734  else {
19735  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(2, 1, __pyx_L3_error)
19736  }
19737  }
19738  if (unlikely(kw_args > 0)) {
19739  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Enum") < 0)) __PYX_ERR(2, 1, __pyx_L3_error)
19740  }
19741  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
19742  goto __pyx_L5_argtuple_error;
19743  } else {
19744  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
19745  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
19746  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
19747  }
19748  __pyx_v___pyx_type = values[0];
19749  __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error)
19750  __pyx_v___pyx_state = values[2];
19751  }
19752  goto __pyx_L4_argument_unpacking_done;
19753  __pyx_L5_argtuple_error:;
19754  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 1, __pyx_L3_error)
19755  __pyx_L3_error:;
19756  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
19757  __Pyx_RefNannyFinishContext();
19758  return NULL;
19759  __pyx_L4_argument_unpacking_done:;
19760  __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
19761 
19762  /* function exit code */
19763  __Pyx_RefNannyFinishContext();
19764  return __pyx_r;
19765 }
19766 
19767 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
19768  PyObject *__pyx_v___pyx_PickleError = 0;
19769  PyObject *__pyx_v___pyx_result = 0;
19770  PyObject *__pyx_r = NULL;
19771  __Pyx_TraceDeclarations
19772  __Pyx_RefNannyDeclarations
19773  PyObject *__pyx_t_1 = NULL;
19774  int __pyx_t_2;
19775  int __pyx_t_3;
19776  PyObject *__pyx_t_4 = NULL;
19777  PyObject *__pyx_t_5 = NULL;
19778  PyObject *__pyx_t_6 = NULL;
19779  int __pyx_lineno = 0;
19780  const char *__pyx_filename = NULL;
19781  int __pyx_clineno = 0;
19782  __Pyx_TraceFrameInit(__pyx_codeobj__21)
19783  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 0);
19784  __Pyx_TraceCall("__pyx_unpickle_Enum", __pyx_f[2], 1, 0, __PYX_ERR(2, 1, __pyx_L1_error));
19785 
19786  /* "(tree fragment)":4
19787  * cdef object __pyx_PickleError
19788  * cdef object __pyx_result
19789  * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995): # <<<<<<<<<<<<<<
19790  * from pickle import PickleError as __pyx_PickleError
19791  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
19792  */
19793  __Pyx_TraceLine(4,0,__PYX_ERR(2, 4, __pyx_L1_error))
19794  __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error)
19795  __Pyx_GOTREF(__pyx_t_1);
19796  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__22, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 4, __pyx_L1_error)
19797  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19798  __pyx_t_3 = (__pyx_t_2 != 0);
19799  if (__pyx_t_3) {
19800 
19801  /* "(tree fragment)":5
19802  * cdef object __pyx_result
19803  * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995):
19804  * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<
19805  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
19806  * __pyx_result = Enum.__new__(__pyx_type)
19807  */
19808  __Pyx_TraceLine(5,0,__PYX_ERR(2, 5, __pyx_L1_error))
19809  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
19810  __Pyx_GOTREF(__pyx_t_1);
19811  __Pyx_INCREF(__pyx_n_s_PickleError);
19812  __Pyx_GIVEREF(__pyx_n_s_PickleError);
19813  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError);
19814  __pyx_t_4 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 5, __pyx_L1_error)
19815  __Pyx_GOTREF(__pyx_t_4);
19816  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19817  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
19818  __Pyx_GOTREF(__pyx_t_1);
19819  __Pyx_INCREF(__pyx_t_1);
19820  __pyx_v___pyx_PickleError = __pyx_t_1;
19821  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19822  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19823 
19824  /* "(tree fragment)":6
19825  * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995):
19826  * from pickle import PickleError as __pyx_PickleError
19827  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum) # <<<<<<<<<<<<<<
19828  * __pyx_result = Enum.__new__(__pyx_type)
19829  * if __pyx_state is not None:
19830  */
19831  __Pyx_TraceLine(6,0,__PYX_ERR(2, 6, __pyx_L1_error))
19832  __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 6, __pyx_L1_error)
19833  __Pyx_GOTREF(__pyx_t_1);
19834  __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 6, __pyx_L1_error)
19835  __Pyx_GOTREF(__pyx_t_5);
19836  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19837  __Pyx_INCREF(__pyx_v___pyx_PickleError);
19838  __pyx_t_1 = __pyx_v___pyx_PickleError; __pyx_t_6 = NULL;
19839  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
19840  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
19841  if (likely(__pyx_t_6)) {
19842  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
19843  __Pyx_INCREF(__pyx_t_6);
19844  __Pyx_INCREF(function);
19845  __Pyx_DECREF_SET(__pyx_t_1, function);
19846  }
19847  }
19848  __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5);
19849  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
19850  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
19851  if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 6, __pyx_L1_error)
19852  __Pyx_GOTREF(__pyx_t_4);
19853  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19854  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
19855  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19856  __PYX_ERR(2, 6, __pyx_L1_error)
19857 
19858  /* "(tree fragment)":4
19859  * cdef object __pyx_PickleError
19860  * cdef object __pyx_result
19861  * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995): # <<<<<<<<<<<<<<
19862  * from pickle import PickleError as __pyx_PickleError
19863  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
19864  */
19865  }
19866 
19867  /* "(tree fragment)":7
19868  * from pickle import PickleError as __pyx_PickleError
19869  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
19870  * __pyx_result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<<
19871  * if __pyx_state is not None:
19872  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
19873  */
19874  __Pyx_TraceLine(7,0,__PYX_ERR(2, 7, __pyx_L1_error))
19875  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 7, __pyx_L1_error)
19876  __Pyx_GOTREF(__pyx_t_1);
19877  __pyx_t_5 = NULL;
19878  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
19879  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
19880  if (likely(__pyx_t_5)) {
19881  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
19882  __Pyx_INCREF(__pyx_t_5);
19883  __Pyx_INCREF(function);
19884  __Pyx_DECREF_SET(__pyx_t_1, function);
19885  }
19886  }
19887  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v___pyx_type);
19888  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
19889  if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 7, __pyx_L1_error)
19890  __Pyx_GOTREF(__pyx_t_4);
19891  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19892  __pyx_v___pyx_result = __pyx_t_4;
19893  __pyx_t_4 = 0;
19894 
19895  /* "(tree fragment)":8
19896  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
19897  * __pyx_result = Enum.__new__(__pyx_type)
19898  * if __pyx_state is not None: # <<<<<<<<<<<<<<
19899  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
19900  * return __pyx_result
19901  */
19902  __Pyx_TraceLine(8,0,__PYX_ERR(2, 8, __pyx_L1_error))
19903  __pyx_t_3 = (__pyx_v___pyx_state != Py_None);
19904  __pyx_t_2 = (__pyx_t_3 != 0);
19905  if (__pyx_t_2) {
19906 
19907  /* "(tree fragment)":9
19908  * __pyx_result = Enum.__new__(__pyx_type)
19909  * if __pyx_state is not None:
19910  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
19911  * return __pyx_result
19912  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
19913  */
19914  __Pyx_TraceLine(9,0,__PYX_ERR(2, 9, __pyx_L1_error))
19915  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||((void)PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 9, __pyx_L1_error)
19916  __pyx_t_4 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 9, __pyx_L1_error)
19917  __Pyx_GOTREF(__pyx_t_4);
19918  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19919 
19920  /* "(tree fragment)":8
19921  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
19922  * __pyx_result = Enum.__new__(__pyx_type)
19923  * if __pyx_state is not None: # <<<<<<<<<<<<<<
19924  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
19925  * return __pyx_result
19926  */
19927  }
19928 
19929  /* "(tree fragment)":10
19930  * if __pyx_state is not None:
19931  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
19932  * return __pyx_result # <<<<<<<<<<<<<<
19933  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
19934  * __pyx_result.name = __pyx_state[0]
19935  */
19936  __Pyx_TraceLine(10,0,__PYX_ERR(2, 10, __pyx_L1_error))
19937  __Pyx_XDECREF(__pyx_r);
19938  __Pyx_INCREF(__pyx_v___pyx_result);
19939  __pyx_r = __pyx_v___pyx_result;
19940  goto __pyx_L0;
19941 
19942  /* "(tree fragment)":1
19943  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
19944  * cdef object __pyx_PickleError
19945  * cdef object __pyx_result
19946  */
19947 
19948  /* function exit code */
19949  __pyx_L1_error:;
19950  __Pyx_XDECREF(__pyx_t_1);
19951  __Pyx_XDECREF(__pyx_t_4);
19952  __Pyx_XDECREF(__pyx_t_5);
19953  __Pyx_XDECREF(__pyx_t_6);
19954  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
19955  __pyx_r = NULL;
19956  __pyx_L0:;
19957  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
19958  __Pyx_XDECREF(__pyx_v___pyx_result);
19959  __Pyx_XGIVEREF(__pyx_r);
19960  __Pyx_TraceReturn(__pyx_r, 0);
19961  __Pyx_RefNannyFinishContext();
19962  return __pyx_r;
19963 }
19964 
19965 /* "(tree fragment)":11
19966  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
19967  * return __pyx_result
19968  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
19969  * __pyx_result.name = __pyx_state[0]
19970  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
19971  */
19972 
19973 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
19974  PyObject *__pyx_r = NULL;
19975  __Pyx_TraceDeclarations
19976  __Pyx_RefNannyDeclarations
19977  PyObject *__pyx_t_1 = NULL;
19978  int __pyx_t_2;
19979  Py_ssize_t __pyx_t_3;
19980  int __pyx_t_4;
19981  int __pyx_t_5;
19982  PyObject *__pyx_t_6 = NULL;
19983  PyObject *__pyx_t_7 = NULL;
19984  PyObject *__pyx_t_8 = NULL;
19985  int __pyx_lineno = 0;
19986  const char *__pyx_filename = NULL;
19987  int __pyx_clineno = 0;
19988  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0);
19989  __Pyx_TraceCall("__pyx_unpickle_Enum__set_state", __pyx_f[2], 11, 0, __PYX_ERR(2, 11, __pyx_L1_error));
19990 
19991  /* "(tree fragment)":12
19992  * return __pyx_result
19993  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
19994  * __pyx_result.name = __pyx_state[0] # <<<<<<<<<<<<<<
19995  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
19996  * __pyx_result.__dict__.update(__pyx_state[1])
19997  */
19998  __Pyx_TraceLine(12,0,__PYX_ERR(2, 12, __pyx_L1_error))
19999  if (unlikely(__pyx_v___pyx_state == Py_None)) {
20000  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
20001  __PYX_ERR(2, 12, __pyx_L1_error)
20002  }
20003  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
20004  __Pyx_GOTREF(__pyx_t_1);
20005  __Pyx_GIVEREF(__pyx_t_1);
20006  __Pyx_GOTREF(__pyx_v___pyx_result->name);
20007  __Pyx_DECREF(__pyx_v___pyx_result->name);
20008  __pyx_v___pyx_result->name = __pyx_t_1;
20009  __pyx_t_1 = 0;
20010 
20011  /* "(tree fragment)":13
20012  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
20013  * __pyx_result.name = __pyx_state[0]
20014  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
20015  * __pyx_result.__dict__.update(__pyx_state[1])
20016  */
20017  __Pyx_TraceLine(13,0,__PYX_ERR(2, 13, __pyx_L1_error))
20018  if (unlikely(__pyx_v___pyx_state == Py_None)) {
20019  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
20020  __PYX_ERR(2, 13, __pyx_L1_error)
20021  }
20022  __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
20023  __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
20024  if (__pyx_t_4) {
20025  } else {
20026  __pyx_t_2 = __pyx_t_4;
20027  goto __pyx_L4_bool_binop_done;
20028  }
20029  __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
20030  __pyx_t_5 = (__pyx_t_4 != 0);
20031  __pyx_t_2 = __pyx_t_5;
20032  __pyx_L4_bool_binop_done:;
20033  if (__pyx_t_2) {
20034 
20035  /* "(tree fragment)":14
20036  * __pyx_result.name = __pyx_state[0]
20037  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
20038  * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<<
20039  */
20040  __Pyx_TraceLine(14,0,__PYX_ERR(2, 14, __pyx_L1_error))
20041  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 14, __pyx_L1_error)
20042  __Pyx_GOTREF(__pyx_t_6);
20043  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 14, __pyx_L1_error)
20044  __Pyx_GOTREF(__pyx_t_7);
20045  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20046  if (unlikely(__pyx_v___pyx_state == Py_None)) {
20047  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
20048  __PYX_ERR(2, 14, __pyx_L1_error)
20049  }
20050  __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 14, __pyx_L1_error)
20051  __Pyx_GOTREF(__pyx_t_6);
20052  __pyx_t_8 = NULL;
20053  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
20054  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
20055  if (likely(__pyx_t_8)) {
20056  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
20057  __Pyx_INCREF(__pyx_t_8);
20058  __Pyx_INCREF(function);
20059  __Pyx_DECREF_SET(__pyx_t_7, function);
20060  }
20061  }
20062  __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
20063  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
20064  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20065  if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 14, __pyx_L1_error)
20066  __Pyx_GOTREF(__pyx_t_1);
20067  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
20068  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20069 
20070  /* "(tree fragment)":13
20071  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
20072  * __pyx_result.name = __pyx_state[0]
20073  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
20074  * __pyx_result.__dict__.update(__pyx_state[1])
20075  */
20076  }
20077 
20078  /* "(tree fragment)":11
20079  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
20080  * return __pyx_result
20081  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
20082  * __pyx_result.name = __pyx_state[0]
20083  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
20084  */
20085 
20086  /* function exit code */
20087  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
20088  goto __pyx_L0;
20089  __pyx_L1_error:;
20090  __Pyx_XDECREF(__pyx_t_1);
20091  __Pyx_XDECREF(__pyx_t_6);
20092  __Pyx_XDECREF(__pyx_t_7);
20093  __Pyx_XDECREF(__pyx_t_8);
20094  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
20095  __pyx_r = 0;
20096  __pyx_L0:;
20097  __Pyx_XGIVEREF(__pyx_r);
20098  __Pyx_TraceReturn(__pyx_r, 0);
20099  __Pyx_RefNannyFinishContext();
20100  return __pyx_r;
20101 }
20102 static struct __pyx_vtabstruct_array __pyx_vtable_array;
20103 
20104 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
20105  struct __pyx_array_obj *p;
20106  PyObject *o;
20107  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
20108  o = (*t->tp_alloc)(t, 0);
20109  } else {
20110  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
20111  }
20112  if (unlikely(!o)) return 0;
20113  p = ((struct __pyx_array_obj *)o);
20114  p->__pyx_vtab = __pyx_vtabptr_array;
20115  p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
20116  p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
20117  if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad;
20118  return o;
20119  bad:
20120  Py_DECREF(o); o = 0;
20121  return NULL;
20122 }
20123 
20124 static void __pyx_tp_dealloc_array(PyObject *o) {
20125  struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
20126  #if CYTHON_USE_TP_FINALIZE
20127  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
20128  if (PyObject_CallFinalizerFromDealloc(o)) return;
20129  }
20130  #endif
20131  {
20132  PyObject *etype, *eval, *etb;
20133  PyErr_Fetch(&etype, &eval, &etb);
20134  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
20135  __pyx_array___dealloc__(o);
20136  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
20137  PyErr_Restore(etype, eval, etb);
20138  }
20139  Py_CLEAR(p->mode);
20140  Py_CLEAR(p->_format);
20141  (*Py_TYPE(o)->tp_free)(o);
20142 }
20143 static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
20144  PyObject *r;
20145  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
20146  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
20147  Py_DECREF(x);
20148  return r;
20149 }
20150 
20151 static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
20152  if (v) {
20153  return __pyx_array___setitem__(o, i, v);
20154  }
20155  else {
20156  PyErr_Format(PyExc_NotImplementedError,
20157  "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
20158  return -1;
20159  }
20160 }
20161 
20162 static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
20163  PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n);
20164  if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
20165  PyErr_Clear();
20166  v = __pyx_array___getattr__(o, n);
20167  }
20168  return v;
20169 }
20170 
20171 static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
20172  return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
20173 }
20174 
20175 static PyMethodDef __pyx_methods_array[] = {
20176  {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
20177  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0},
20178  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0},
20179  {0, 0, 0, 0}
20180 };
20181 
20182 static struct PyGetSetDef __pyx_getsets_array[] = {
20183  {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0},
20184  {0, 0, 0, 0, 0}
20185 };
20186 
20187 static PySequenceMethods __pyx_tp_as_sequence_array = {
20188  __pyx_array___len__, /*sq_length*/
20189  0, /*sq_concat*/
20190  0, /*sq_repeat*/
20191  __pyx_sq_item_array, /*sq_item*/
20192  0, /*sq_slice*/
20193  0, /*sq_ass_item*/
20194  0, /*sq_ass_slice*/
20195  0, /*sq_contains*/
20196  0, /*sq_inplace_concat*/
20197  0, /*sq_inplace_repeat*/
20198 };
20199 
20200 static PyMappingMethods __pyx_tp_as_mapping_array = {
20201  __pyx_array___len__, /*mp_length*/
20202  __pyx_array___getitem__, /*mp_subscript*/
20203  __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/
20204 };
20205 
20206 static PyBufferProcs __pyx_tp_as_buffer_array = {
20207  #if PY_MAJOR_VERSION < 3
20208  0, /*bf_getreadbuffer*/
20209  #endif
20210  #if PY_MAJOR_VERSION < 3
20211  0, /*bf_getwritebuffer*/
20212  #endif
20213  #if PY_MAJOR_VERSION < 3
20214  0, /*bf_getsegcount*/
20215  #endif
20216  #if PY_MAJOR_VERSION < 3
20217  0, /*bf_getcharbuffer*/
20218  #endif
20219  __pyx_array_getbuffer, /*bf_getbuffer*/
20220  0, /*bf_releasebuffer*/
20221 };
20222 
20223 static PyTypeObject __pyx_type___pyx_array = {
20224  PyVarObject_HEAD_INIT(0, 0)
20225  "imate._c_trace_estimator.py_c_trace_estimator.array", /*tp_name*/
20226  sizeof(struct __pyx_array_obj), /*tp_basicsize*/
20227  0, /*tp_itemsize*/
20228  __pyx_tp_dealloc_array, /*tp_dealloc*/
20229  #if PY_VERSION_HEX < 0x030800b4
20230  0, /*tp_print*/
20231  #endif
20232  #if PY_VERSION_HEX >= 0x030800b4
20233  0, /*tp_vectorcall_offset*/
20234  #endif
20235  0, /*tp_getattr*/
20236  0, /*tp_setattr*/
20237  #if PY_MAJOR_VERSION < 3
20238  0, /*tp_compare*/
20239  #endif
20240  #if PY_MAJOR_VERSION >= 3
20241  0, /*tp_as_async*/
20242  #endif
20243  0, /*tp_repr*/
20244  0, /*tp_as_number*/
20245  &__pyx_tp_as_sequence_array, /*tp_as_sequence*/
20246  &__pyx_tp_as_mapping_array, /*tp_as_mapping*/
20247  0, /*tp_hash*/
20248  0, /*tp_call*/
20249  0, /*tp_str*/
20250  __pyx_tp_getattro_array, /*tp_getattro*/
20251  0, /*tp_setattro*/
20252  &__pyx_tp_as_buffer_array, /*tp_as_buffer*/
20253  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
20254  0, /*tp_doc*/
20255  0, /*tp_traverse*/
20256  0, /*tp_clear*/
20257  0, /*tp_richcompare*/
20258  0, /*tp_weaklistoffset*/
20259  0, /*tp_iter*/
20260  0, /*tp_iternext*/
20261  __pyx_methods_array, /*tp_methods*/
20262  0, /*tp_members*/
20263  __pyx_getsets_array, /*tp_getset*/
20264  0, /*tp_base*/
20265  0, /*tp_dict*/
20266  0, /*tp_descr_get*/
20267  0, /*tp_descr_set*/
20268  0, /*tp_dictoffset*/
20269  0, /*tp_init*/
20270  0, /*tp_alloc*/
20271  __pyx_tp_new_array, /*tp_new*/
20272  0, /*tp_free*/
20273  0, /*tp_is_gc*/
20274  0, /*tp_bases*/
20275  0, /*tp_mro*/
20276  0, /*tp_cache*/
20277  0, /*tp_subclasses*/
20278  0, /*tp_weaklist*/
20279  0, /*tp_del*/
20280  0, /*tp_version_tag*/
20281  #if PY_VERSION_HEX >= 0x030400a1
20282  0, /*tp_finalize*/
20283  #endif
20284  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
20285  0, /*tp_vectorcall*/
20286  #endif
20287  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
20288  0, /*tp_print*/
20289  #endif
20290  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
20291  0, /*tp_pypy_flags*/
20292  #endif
20293 };
20294 
20295 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
20296  struct __pyx_MemviewEnum_obj *p;
20297  PyObject *o;
20298  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
20299  o = (*t->tp_alloc)(t, 0);
20300  } else {
20301  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
20302  }
20303  if (unlikely(!o)) return 0;
20304  p = ((struct __pyx_MemviewEnum_obj *)o);
20305  p->name = Py_None; Py_INCREF(Py_None);
20306  return o;
20307 }
20308 
20309 static void __pyx_tp_dealloc_Enum(PyObject *o) {
20310  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
20311  #if CYTHON_USE_TP_FINALIZE
20312  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !__Pyx_PyObject_GC_IsFinalized(o)) {
20313  if (PyObject_CallFinalizerFromDealloc(o)) return;
20314  }
20315  #endif
20316  PyObject_GC_UnTrack(o);
20317  Py_CLEAR(p->name);
20318  (*Py_TYPE(o)->tp_free)(o);
20319 }
20320 
20321 static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) {
20322  int e;
20323  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
20324  if (p->name) {
20325  e = (*v)(p->name, a); if (e) return e;
20326  }
20327  return 0;
20328 }
20329 
20330 static int __pyx_tp_clear_Enum(PyObject *o) {
20331  PyObject* tmp;
20332  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
20333  tmp = ((PyObject*)p->name);
20334  p->name = Py_None; Py_INCREF(Py_None);
20335  Py_XDECREF(tmp);
20336  return 0;
20337 }
20338 
20339 static PyMethodDef __pyx_methods_Enum[] = {
20340  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0},
20341  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0},
20342  {0, 0, 0, 0}
20343 };
20344 
20345 static PyTypeObject __pyx_type___pyx_MemviewEnum = {
20346  PyVarObject_HEAD_INIT(0, 0)
20347  "imate._c_trace_estimator.py_c_trace_estimator.Enum", /*tp_name*/
20348  sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
20349  0, /*tp_itemsize*/
20350  __pyx_tp_dealloc_Enum, /*tp_dealloc*/
20351  #if PY_VERSION_HEX < 0x030800b4
20352  0, /*tp_print*/
20353  #endif
20354  #if PY_VERSION_HEX >= 0x030800b4
20355  0, /*tp_vectorcall_offset*/
20356  #endif
20357  0, /*tp_getattr*/
20358  0, /*tp_setattr*/
20359  #if PY_MAJOR_VERSION < 3
20360  0, /*tp_compare*/
20361  #endif
20362  #if PY_MAJOR_VERSION >= 3
20363  0, /*tp_as_async*/
20364  #endif
20365  __pyx_MemviewEnum___repr__, /*tp_repr*/
20366  0, /*tp_as_number*/
20367  0, /*tp_as_sequence*/
20368  0, /*tp_as_mapping*/
20369  0, /*tp_hash*/
20370  0, /*tp_call*/
20371  0, /*tp_str*/
20372  0, /*tp_getattro*/
20373  0, /*tp_setattro*/
20374  0, /*tp_as_buffer*/
20375  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
20376  0, /*tp_doc*/
20377  __pyx_tp_traverse_Enum, /*tp_traverse*/
20378  __pyx_tp_clear_Enum, /*tp_clear*/
20379  0, /*tp_richcompare*/
20380  0, /*tp_weaklistoffset*/
20381  0, /*tp_iter*/
20382  0, /*tp_iternext*/
20383  __pyx_methods_Enum, /*tp_methods*/
20384  0, /*tp_members*/
20385  0, /*tp_getset*/
20386  0, /*tp_base*/
20387  0, /*tp_dict*/
20388  0, /*tp_descr_get*/
20389  0, /*tp_descr_set*/
20390  0, /*tp_dictoffset*/
20391  __pyx_MemviewEnum___init__, /*tp_init*/
20392  0, /*tp_alloc*/
20393  __pyx_tp_new_Enum, /*tp_new*/
20394  0, /*tp_free*/
20395  0, /*tp_is_gc*/
20396  0, /*tp_bases*/
20397  0, /*tp_mro*/
20398  0, /*tp_cache*/
20399  0, /*tp_subclasses*/
20400  0, /*tp_weaklist*/
20401  0, /*tp_del*/
20402  0, /*tp_version_tag*/
20403  #if PY_VERSION_HEX >= 0x030400a1
20404  0, /*tp_finalize*/
20405  #endif
20406  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
20407  0, /*tp_vectorcall*/
20408  #endif
20409  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
20410  0, /*tp_print*/
20411  #endif
20412  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
20413  0, /*tp_pypy_flags*/
20414  #endif
20415 };
20416 static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
20417 
20418 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
20419  struct __pyx_memoryview_obj *p;
20420  PyObject *o;
20421  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
20422  o = (*t->tp_alloc)(t, 0);
20423  } else {
20424  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
20425  }
20426  if (unlikely(!o)) return 0;
20427  p = ((struct __pyx_memoryview_obj *)o);
20428  p->__pyx_vtab = __pyx_vtabptr_memoryview;
20429  p->obj = Py_None; Py_INCREF(Py_None);
20430  p->_size = Py_None; Py_INCREF(Py_None);
20431  p->_array_interface = Py_None; Py_INCREF(Py_None);
20432  p->view.obj = NULL;
20433  if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad;
20434  return o;
20435  bad:
20436  Py_DECREF(o); o = 0;
20437  return NULL;
20438 }
20439 
20440 static void __pyx_tp_dealloc_memoryview(PyObject *o) {
20441  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
20442  #if CYTHON_USE_TP_FINALIZE
20443  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !__Pyx_PyObject_GC_IsFinalized(o)) {
20444  if (PyObject_CallFinalizerFromDealloc(o)) return;
20445  }
20446  #endif
20447  PyObject_GC_UnTrack(o);
20448  {
20449  PyObject *etype, *eval, *etb;
20450  PyErr_Fetch(&etype, &eval, &etb);
20451  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
20452  __pyx_memoryview___dealloc__(o);
20453  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
20454  PyErr_Restore(etype, eval, etb);
20455  }
20456  Py_CLEAR(p->obj);
20457  Py_CLEAR(p->_size);
20458  Py_CLEAR(p->_array_interface);
20459  (*Py_TYPE(o)->tp_free)(o);
20460 }
20461 
20462 static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) {
20463  int e;
20464  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
20465  if (p->obj) {
20466  e = (*v)(p->obj, a); if (e) return e;
20467  }
20468  if (p->_size) {
20469  e = (*v)(p->_size, a); if (e) return e;
20470  }
20471  if (p->_array_interface) {
20472  e = (*v)(p->_array_interface, a); if (e) return e;
20473  }
20474  if (p->view.obj) {
20475  e = (*v)(p->view.obj, a); if (e) return e;
20476  }
20477  return 0;
20478 }
20479 
20480 static int __pyx_tp_clear_memoryview(PyObject *o) {
20481  PyObject* tmp;
20482  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
20483  tmp = ((PyObject*)p->obj);
20484  p->obj = Py_None; Py_INCREF(Py_None);
20485  Py_XDECREF(tmp);
20486  tmp = ((PyObject*)p->_size);
20487  p->_size = Py_None; Py_INCREF(Py_None);
20488  Py_XDECREF(tmp);
20489  tmp = ((PyObject*)p->_array_interface);
20490  p->_array_interface = Py_None; Py_INCREF(Py_None);
20491  Py_XDECREF(tmp);
20492  Py_CLEAR(p->view.obj);
20493  return 0;
20494 }
20495 static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
20496  PyObject *r;
20497  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
20498  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
20499  Py_DECREF(x);
20500  return r;
20501 }
20502 
20503 static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
20504  if (v) {
20505  return __pyx_memoryview___setitem__(o, i, v);
20506  }
20507  else {
20508  PyErr_Format(PyExc_NotImplementedError,
20509  "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
20510  return -1;
20511  }
20512 }
20513 
20514 static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
20515  return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
20516 }
20517 
20518 static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
20519  return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
20520 }
20521 
20522 static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
20523  return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
20524 }
20525 
20526 static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
20527  return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
20528 }
20529 
20530 static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
20531  return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
20532 }
20533 
20534 static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
20535  return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
20536 }
20537 
20538 static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
20539  return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
20540 }
20541 
20542 static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
20543  return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
20544 }
20545 
20546 static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
20547  return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
20548 }
20549 
20550 static PyMethodDef __pyx_methods_memoryview[] = {
20551  {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
20552  {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
20553  {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
20554  {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
20555  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0},
20556  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0},
20557  {0, 0, 0, 0}
20558 };
20559 
20560 static struct PyGetSetDef __pyx_getsets_memoryview[] = {
20561  {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0},
20562  {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0},
20563  {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0},
20564  {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0},
20565  {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0},
20566  {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0},
20567  {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0},
20568  {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0},
20569  {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0},
20570  {0, 0, 0, 0, 0}
20571 };
20572 
20573 static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
20574  __pyx_memoryview___len__, /*sq_length*/
20575  0, /*sq_concat*/
20576  0, /*sq_repeat*/
20577  __pyx_sq_item_memoryview, /*sq_item*/
20578  0, /*sq_slice*/
20579  0, /*sq_ass_item*/
20580  0, /*sq_ass_slice*/
20581  0, /*sq_contains*/
20582  0, /*sq_inplace_concat*/
20583  0, /*sq_inplace_repeat*/
20584 };
20585 
20586 static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
20587  __pyx_memoryview___len__, /*mp_length*/
20588  __pyx_memoryview___getitem__, /*mp_subscript*/
20589  __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/
20590 };
20591 
20592 static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
20593  #if PY_MAJOR_VERSION < 3
20594  0, /*bf_getreadbuffer*/
20595  #endif
20596  #if PY_MAJOR_VERSION < 3
20597  0, /*bf_getwritebuffer*/
20598  #endif
20599  #if PY_MAJOR_VERSION < 3
20600  0, /*bf_getsegcount*/
20601  #endif
20602  #if PY_MAJOR_VERSION < 3
20603  0, /*bf_getcharbuffer*/
20604  #endif
20605  __pyx_memoryview_getbuffer, /*bf_getbuffer*/
20606  0, /*bf_releasebuffer*/
20607 };
20608 
20609 static PyTypeObject __pyx_type___pyx_memoryview = {
20610  PyVarObject_HEAD_INIT(0, 0)
20611  "imate._c_trace_estimator.py_c_trace_estimator.memoryview", /*tp_name*/
20612  sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
20613  0, /*tp_itemsize*/
20614  __pyx_tp_dealloc_memoryview, /*tp_dealloc*/
20615  #if PY_VERSION_HEX < 0x030800b4
20616  0, /*tp_print*/
20617  #endif
20618  #if PY_VERSION_HEX >= 0x030800b4
20619  0, /*tp_vectorcall_offset*/
20620  #endif
20621  0, /*tp_getattr*/
20622  0, /*tp_setattr*/
20623  #if PY_MAJOR_VERSION < 3
20624  0, /*tp_compare*/
20625  #endif
20626  #if PY_MAJOR_VERSION >= 3
20627  0, /*tp_as_async*/
20628  #endif
20629  __pyx_memoryview___repr__, /*tp_repr*/
20630  0, /*tp_as_number*/
20631  &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/
20632  &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/
20633  0, /*tp_hash*/
20634  0, /*tp_call*/
20635  __pyx_memoryview___str__, /*tp_str*/
20636  0, /*tp_getattro*/
20637  0, /*tp_setattro*/
20638  &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/
20639  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
20640  0, /*tp_doc*/
20641  __pyx_tp_traverse_memoryview, /*tp_traverse*/
20642  __pyx_tp_clear_memoryview, /*tp_clear*/
20643  0, /*tp_richcompare*/
20644  0, /*tp_weaklistoffset*/
20645  0, /*tp_iter*/
20646  0, /*tp_iternext*/
20647  __pyx_methods_memoryview, /*tp_methods*/
20648  0, /*tp_members*/
20649  __pyx_getsets_memoryview, /*tp_getset*/
20650  0, /*tp_base*/
20651  0, /*tp_dict*/
20652  0, /*tp_descr_get*/
20653  0, /*tp_descr_set*/
20654  0, /*tp_dictoffset*/
20655  0, /*tp_init*/
20656  0, /*tp_alloc*/
20657  __pyx_tp_new_memoryview, /*tp_new*/
20658  0, /*tp_free*/
20659  0, /*tp_is_gc*/
20660  0, /*tp_bases*/
20661  0, /*tp_mro*/
20662  0, /*tp_cache*/
20663  0, /*tp_subclasses*/
20664  0, /*tp_weaklist*/
20665  0, /*tp_del*/
20666  0, /*tp_version_tag*/
20667  #if PY_VERSION_HEX >= 0x030400a1
20668  0, /*tp_finalize*/
20669  #endif
20670  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
20671  0, /*tp_vectorcall*/
20672  #endif
20673  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
20674  0, /*tp_print*/
20675  #endif
20676  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
20677  0, /*tp_pypy_flags*/
20678  #endif
20679 };
20680 static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
20681 
20682 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
20683  struct __pyx_memoryviewslice_obj *p;
20684  PyObject *o = __pyx_tp_new_memoryview(t, a, k);
20685  if (unlikely(!o)) return 0;
20686  p = ((struct __pyx_memoryviewslice_obj *)o);
20687  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
20688  p->from_object = Py_None; Py_INCREF(Py_None);
20689  p->from_slice.memview = NULL;
20690  return o;
20691 }
20692 
20693 static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
20694  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
20695  #if CYTHON_USE_TP_FINALIZE
20696  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !__Pyx_PyObject_GC_IsFinalized(o)) {
20697  if (PyObject_CallFinalizerFromDealloc(o)) return;
20698  }
20699  #endif
20700  PyObject_GC_UnTrack(o);
20701  {
20702  PyObject *etype, *eval, *etb;
20703  PyErr_Fetch(&etype, &eval, &etb);
20704  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
20705  __pyx_memoryviewslice___dealloc__(o);
20706  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
20707  PyErr_Restore(etype, eval, etb);
20708  }
20709  Py_CLEAR(p->from_object);
20710  PyObject_GC_Track(o);
20711  __pyx_tp_dealloc_memoryview(o);
20712 }
20713 
20714 static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) {
20715  int e;
20716  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
20717  e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e;
20718  if (p->from_object) {
20719  e = (*v)(p->from_object, a); if (e) return e;
20720  }
20721  return 0;
20722 }
20723 
20724 static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
20725  PyObject* tmp;
20726  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
20727  __pyx_tp_clear_memoryview(o);
20728  tmp = ((PyObject*)p->from_object);
20729  p->from_object = Py_None; Py_INCREF(Py_None);
20730  Py_XDECREF(tmp);
20731  __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
20732  return 0;
20733 }
20734 
20735 static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) {
20736  return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
20737 }
20738 
20739 static PyMethodDef __pyx_methods__memoryviewslice[] = {
20740  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0},
20741  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0},
20742  {0, 0, 0, 0}
20743 };
20744 
20745 static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
20746  {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (char *)0, 0},
20747  {0, 0, 0, 0, 0}
20748 };
20749 
20750 static PyTypeObject __pyx_type___pyx_memoryviewslice = {
20751  PyVarObject_HEAD_INIT(0, 0)
20752  "imate._c_trace_estimator.py_c_trace_estimator._memoryviewslice", /*tp_name*/
20753  sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
20754  0, /*tp_itemsize*/
20755  __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
20756  #if PY_VERSION_HEX < 0x030800b4
20757  0, /*tp_print*/
20758  #endif
20759  #if PY_VERSION_HEX >= 0x030800b4
20760  0, /*tp_vectorcall_offset*/
20761  #endif
20762  0, /*tp_getattr*/
20763  0, /*tp_setattr*/
20764  #if PY_MAJOR_VERSION < 3
20765  0, /*tp_compare*/
20766  #endif
20767  #if PY_MAJOR_VERSION >= 3
20768  0, /*tp_as_async*/
20769  #endif
20770  #if CYTHON_COMPILING_IN_PYPY
20771  __pyx_memoryview___repr__, /*tp_repr*/
20772  #else
20773  0, /*tp_repr*/
20774  #endif
20775  0, /*tp_as_number*/
20776  0, /*tp_as_sequence*/
20777  0, /*tp_as_mapping*/
20778  0, /*tp_hash*/
20779  0, /*tp_call*/
20780  #if CYTHON_COMPILING_IN_PYPY
20781  __pyx_memoryview___str__, /*tp_str*/
20782  #else
20783  0, /*tp_str*/
20784  #endif
20785  0, /*tp_getattro*/
20786  0, /*tp_setattro*/
20787  0, /*tp_as_buffer*/
20788  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
20789  "Internal class for passing memoryview slices to Python", /*tp_doc*/
20790  __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/
20791  __pyx_tp_clear__memoryviewslice, /*tp_clear*/
20792  0, /*tp_richcompare*/
20793  0, /*tp_weaklistoffset*/
20794  0, /*tp_iter*/
20795  0, /*tp_iternext*/
20796  __pyx_methods__memoryviewslice, /*tp_methods*/
20797  0, /*tp_members*/
20798  __pyx_getsets__memoryviewslice, /*tp_getset*/
20799  0, /*tp_base*/
20800  0, /*tp_dict*/
20801  0, /*tp_descr_get*/
20802  0, /*tp_descr_set*/
20803  0, /*tp_dictoffset*/
20804  0, /*tp_init*/
20805  0, /*tp_alloc*/
20806  __pyx_tp_new__memoryviewslice, /*tp_new*/
20807  0, /*tp_free*/
20808  0, /*tp_is_gc*/
20809  0, /*tp_bases*/
20810  0, /*tp_mro*/
20811  0, /*tp_cache*/
20812  0, /*tp_subclasses*/
20813  0, /*tp_weaklist*/
20814  0, /*tp_del*/
20815  0, /*tp_version_tag*/
20816  #if PY_VERSION_HEX >= 0x030400a1
20817  0, /*tp_finalize*/
20818  #endif
20819  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
20820  0, /*tp_vectorcall*/
20821  #endif
20822  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
20823  0, /*tp_print*/
20824  #endif
20825  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
20826  0, /*tp_pypy_flags*/
20827  #endif
20828 };
20829 
20830 static PyMethodDef __pyx_methods[] = {
20831  {0, 0, 0, 0}
20832 };
20833 
20834 #if PY_MAJOR_VERSION >= 3
20835 #if CYTHON_PEP489_MULTI_PHASE_INIT
20836 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
20837 static int __pyx_pymod_exec_py_c_trace_estimator(PyObject* module); /*proto*/
20838 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
20839  {Py_mod_create, (void*)__pyx_pymod_create},
20840  {Py_mod_exec, (void*)__pyx_pymod_exec_py_c_trace_estimator},
20841  {0, NULL}
20842 };
20843 #endif
20844 
20845 static struct PyModuleDef __pyx_moduledef = {
20846  PyModuleDef_HEAD_INIT,
20847  "py_c_trace_estimator",
20848  0, /* m_doc */
20849  #if CYTHON_PEP489_MULTI_PHASE_INIT
20850  0, /* m_size */
20851  #else
20852  -1, /* m_size */
20853  #endif
20854  __pyx_methods /* m_methods */,
20855  #if CYTHON_PEP489_MULTI_PHASE_INIT
20856  __pyx_moduledef_slots, /* m_slots */
20857  #else
20858  NULL, /* m_reload */
20859  #endif
20860  NULL, /* m_traverse */
20861  NULL, /* m_clear */
20862  NULL /* m_free */
20863 };
20864 #endif
20865 #ifndef CYTHON_SMALL_CODE
20866 #if defined(__clang__)
20867  #define CYTHON_SMALL_CODE
20868 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
20869  #define CYTHON_SMALL_CODE __attribute__((cold))
20870 #else
20871  #define CYTHON_SMALL_CODE
20872 #endif
20873 #endif
20874 
20875 static __Pyx_StringTabEntry __pyx_string_tab[] = {
20876  {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
20877  {&__pyx_n_s_Aop, __pyx_k_Aop, sizeof(__pyx_k_Aop), 0, 0, 1, 1},
20878  {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0},
20879  {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0},
20880  {&__pyx_kp_s_Cannot_assign_to_read_only_memor, __pyx_k_Cannot_assign_to_read_only_memor, sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 0, 1, 0},
20881  {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi, sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0},
20882  {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s, sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0},
20883  {&__pyx_kp_u_Data_type_should_be_float32_floa, __pyx_k_Data_type_should_be_float32_floa, sizeof(__pyx_k_Data_type_should_be_float32_floa), 0, 1, 0, 0},
20884  {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
20885  {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0},
20886  {&__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_k_Incompatible_checksums_0x_x_vs_0, sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0), 0, 0, 1, 0},
20887  {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
20888  {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
20889  {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr, sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0},
20890  {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d, sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0},
20891  {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
20892  {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x, sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0},
20893  {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
20894  {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1},
20895  {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a, sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0},
20896  {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
20897  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
20898  {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object, sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0},
20899  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
20900  {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
20901  {&__pyx_n_s_alg_wall_times, __pyx_k_alg_wall_times, sizeof(__pyx_k_alg_wall_times), 0, 0, 1, 1},
20902  {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
20903  {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
20904  {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
20905  {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1},
20906  {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
20907  {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
20908  {&__pyx_n_s_confidence_level, __pyx_k_confidence_level, sizeof(__pyx_k_confidence_level), 0, 0, 1, 1},
20909  {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
20910  {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
20911  {&__pyx_n_s_converged, __pyx_k_converged, sizeof(__pyx_k_converged), 0, 0, 1, 1},
20912  {&__pyx_n_s_data_type_name, __pyx_k_data_type_name, sizeof(__pyx_k_data_type_name), 0, 0, 1, 1},
20913  {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
20914  {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
20915  {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
20916  {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
20917  {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
20918  {&__pyx_n_s_error_atol, __pyx_k_error_atol, sizeof(__pyx_k_error_atol), 0, 0, 1, 1},
20919  {&__pyx_n_s_error_rtol, __pyx_k_error_rtol, sizeof(__pyx_k_error_rtol), 0, 0, 1, 1},
20920  {&__pyx_n_s_exponent, __pyx_k_exponent, sizeof(__pyx_k_exponent), 0, 0, 1, 1},
20921  {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
20922  {&__pyx_n_b_float128, __pyx_k_float128, sizeof(__pyx_k_float128), 0, 0, 0, 1},
20923  {&__pyx_n_b_float32, __pyx_k_float32, sizeof(__pyx_k_float32), 0, 0, 0, 1},
20924  {&__pyx_n_b_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 0, 1},
20925  {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
20926  {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1},
20927  {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1},
20928  {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
20929  {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi, sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0},
20930  {&__pyx_n_s_gram, __pyx_k_gram, sizeof(__pyx_k_gram), 0, 0, 1, 1},
20931  {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
20932  {&__pyx_kp_s_imate__c_trace_estimator_py_c_tr, __pyx_k_imate__c_trace_estimator_py_c_tr, sizeof(__pyx_k_imate__c_trace_estimator_py_c_tr), 0, 0, 1, 0},
20933  {&__pyx_n_s_imate__c_trace_estimator_py_c_tr_2, __pyx_k_imate__c_trace_estimator_py_c_tr_2, sizeof(__pyx_k_imate__c_trace_estimator_py_c_tr_2), 0, 0, 1, 1},
20934  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
20935  {&__pyx_n_s_isscalar, __pyx_k_isscalar, sizeof(__pyx_k_isscalar), 0, 0, 1, 1},
20936  {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
20937  {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array, sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0},
20938  {&__pyx_n_s_lanczos_degree, __pyx_k_lanczos_degree, sizeof(__pyx_k_lanczos_degree), 0, 0, 1, 1},
20939  {&__pyx_n_s_lanczos_tol, __pyx_k_lanczos_tol, sizeof(__pyx_k_lanczos_tol), 0, 0, 1, 1},
20940  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
20941  {&__pyx_n_s_max_num_samples, __pyx_k_max_num_samples, sizeof(__pyx_k_max_num_samples), 0, 0, 1, 1},
20942  {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1},
20943  {&__pyx_n_s_min_num_samples, __pyx_k_min_num_samples, sizeof(__pyx_k_min_num_samples), 0, 0, 1, 1},
20944  {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
20945  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
20946  {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
20947  {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1},
20948  {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
20949  {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
20950  {&__pyx_n_s_num_inquiries, __pyx_k_num_inquiries, sizeof(__pyx_k_num_inquiries), 0, 0, 1, 1},
20951  {&__pyx_n_s_num_outliers, __pyx_k_num_outliers, sizeof(__pyx_k_num_outliers), 0, 0, 1, 1},
20952  {&__pyx_n_s_num_samples_used, __pyx_k_num_samples_used, sizeof(__pyx_k_num_samples_used), 0, 0, 1, 1},
20953  {&__pyx_n_s_num_threads, __pyx_k_num_threads, sizeof(__pyx_k_num_threads), 0, 0, 1, 1},
20954  {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
20955  {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
20956  {&__pyx_n_s_outlier_significance_level, __pyx_k_outlier_significance_level, sizeof(__pyx_k_outlier_significance_level), 0, 0, 1, 1},
20957  {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1},
20958  {&__pyx_n_s_parameters, __pyx_k_parameters, sizeof(__pyx_k_parameters), 0, 0, 1, 1},
20959  {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
20960  {&__pyx_n_s_processed_samples_indices, __pyx_k_processed_samples_indices, sizeof(__pyx_k_processed_samples_indices), 0, 0, 1, 1},
20961  {&__pyx_n_s_py_matrix_function, __pyx_k_py_matrix_function, sizeof(__pyx_k_py_matrix_function), 0, 0, 1, 1},
20962  {&__pyx_n_s_pyc_trace_estimator, __pyx_k_pyc_trace_estimator, sizeof(__pyx_k_pyc_trace_estimator), 0, 0, 1, 1},
20963  {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
20964  {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
20965  {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
20966  {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
20967  {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
20968  {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
20969  {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum, sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
20970  {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
20971  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
20972  {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
20973  {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
20974  {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
20975  {&__pyx_n_s_reorthogonalize, __pyx_k_reorthogonalize, sizeof(__pyx_k_reorthogonalize), 0, 0, 1, 1},
20976  {&__pyx_n_s_samples, __pyx_k_samples, sizeof(__pyx_k_samples), 0, 0, 1, 1},
20977  {&__pyx_n_s_seed, __pyx_k_seed, sizeof(__pyx_k_seed), 0, 0, 1, 1},
20978  {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
20979  {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
20980  {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
20981  {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
20982  {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
20983  {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
20984  {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
20985  {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
20986  {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect, sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0},
20987  {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
20988  {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
20989  {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
20990  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
20991  {&__pyx_n_s_trace, __pyx_k_trace, sizeof(__pyx_k_trace), 0, 0, 1, 1},
20992  {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data, sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0},
20993  {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str, sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0},
20994  {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
20995  {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
20996  {0, 0, 0, 0, 0, 0, 0}
20997 };
20998 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
20999  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 160, __pyx_L1_error)
21000  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 230, __pyx_L1_error)
21001  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(2, 134, __pyx_L1_error)
21002  __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(2, 149, __pyx_L1_error)
21003  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(2, 152, __pyx_L1_error)
21004  __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(2, 406, __pyx_L1_error)
21005  __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(2, 615, __pyx_L1_error)
21006  __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(2, 834, __pyx_L1_error)
21007  return 0;
21008  __pyx_L1_error:;
21009  return -1;
21010 }
21011 
21012 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
21013  __Pyx_RefNannyDeclarations
21014  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
21015 
21016  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":160
21017  *
21018  * else:
21019  * raise TypeError('Data type should be "float32", "float64", or ' + # <<<<<<<<<<<<<<
21020  * '"float128".')
21021  *
21022  */
21023  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_Data_type_should_be_float32_floa); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 160, __pyx_L1_error)
21024  __Pyx_GOTREF(__pyx_tuple__2);
21025  __Pyx_GIVEREF(__pyx_tuple__2);
21026 
21027  /* "View.MemoryView":134
21028  *
21029  * if not self.ndim:
21030  * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
21031  *
21032  * if itemsize <= 0:
21033  */
21034  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(2, 134, __pyx_L1_error)
21035  __Pyx_GOTREF(__pyx_tuple__3);
21036  __Pyx_GIVEREF(__pyx_tuple__3);
21037 
21038  /* "View.MemoryView":137
21039  *
21040  * if itemsize <= 0:
21041  * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
21042  *
21043  * if not isinstance(format, bytes):
21044  */
21045  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(2, 137, __pyx_L1_error)
21046  __Pyx_GOTREF(__pyx_tuple__4);
21047  __Pyx_GIVEREF(__pyx_tuple__4);
21048 
21049  /* "View.MemoryView":149
21050  *
21051  * if not self._shape:
21052  * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
21053  *
21054  *
21055  */
21056  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(2, 149, __pyx_L1_error)
21057  __Pyx_GOTREF(__pyx_tuple__5);
21058  __Pyx_GIVEREF(__pyx_tuple__5);
21059 
21060  /* "View.MemoryView":177
21061  * self.data = <char *>malloc(self.len)
21062  * if not self.data:
21063  * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
21064  *
21065  * if self.dtype_is_object:
21066  */
21067  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(2, 177, __pyx_L1_error)
21068  __Pyx_GOTREF(__pyx_tuple__6);
21069  __Pyx_GIVEREF(__pyx_tuple__6);
21070 
21071  /* "View.MemoryView":193
21072  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
21073  * if not (flags & bufmode):
21074  * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
21075  * info.buf = self.data
21076  * info.len = self.len
21077  */
21078  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(2, 193, __pyx_L1_error)
21079  __Pyx_GOTREF(__pyx_tuple__7);
21080  __Pyx_GIVEREF(__pyx_tuple__7);
21081 
21082  /* "(tree fragment)":2
21083  * def __reduce_cython__(self):
21084  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
21085  * def __setstate_cython__(self, __pyx_state):
21086  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
21087  */
21088  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(2, 2, __pyx_L1_error)
21089  __Pyx_GOTREF(__pyx_tuple__8);
21090  __Pyx_GIVEREF(__pyx_tuple__8);
21091 
21092  /* "(tree fragment)":4
21093  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
21094  * def __setstate_cython__(self, __pyx_state):
21095  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
21096  */
21097  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(2, 4, __pyx_L1_error)
21098  __Pyx_GOTREF(__pyx_tuple__9);
21099  __Pyx_GIVEREF(__pyx_tuple__9);
21100 
21101  /* "View.MemoryView":420
21102  * def __setitem__(memoryview self, object index, object value):
21103  * if self.view.readonly:
21104  * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
21105  *
21106  * have_slices, index = _unellipsify(index, self.view.ndim)
21107  */
21108  __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(2, 420, __pyx_L1_error)
21109  __Pyx_GOTREF(__pyx_tuple__10);
21110  __Pyx_GIVEREF(__pyx_tuple__10);
21111 
21112  /* "View.MemoryView":497
21113  * result = struct.unpack(self.view.format, bytesitem)
21114  * except struct.error:
21115  * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
21116  * else:
21117  * if len(self.view.format) == 1:
21118  */
21119  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(2, 497, __pyx_L1_error)
21120  __Pyx_GOTREF(__pyx_tuple__11);
21121  __Pyx_GIVEREF(__pyx_tuple__11);
21122 
21123  /* "View.MemoryView":522
21124  * def __getbuffer__(self, Py_buffer *info, int flags):
21125  * if flags & PyBUF_WRITABLE and self.view.readonly:
21126  * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
21127  *
21128  * if flags & PyBUF_ND:
21129  */
21130  __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(2, 522, __pyx_L1_error)
21131  __Pyx_GOTREF(__pyx_tuple__12);
21132  __Pyx_GIVEREF(__pyx_tuple__12);
21133 
21134  /* "View.MemoryView":572
21135  * if self.view.strides == NULL:
21136  *
21137  * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
21138  *
21139  * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
21140  */
21141  __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(2, 572, __pyx_L1_error)
21142  __Pyx_GOTREF(__pyx_tuple__13);
21143  __Pyx_GIVEREF(__pyx_tuple__13);
21144 
21145  /* "View.MemoryView":579
21146  * def suboffsets(self):
21147  * if self.view.suboffsets == NULL:
21148  * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
21149  *
21150  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
21151  */
21152  __pyx_tuple__14 = PyTuple_New(1); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(2, 579, __pyx_L1_error)
21153  __Pyx_GOTREF(__pyx_tuple__14);
21154  __Pyx_INCREF(__pyx_int_neg_1);
21155  __Pyx_GIVEREF(__pyx_int_neg_1);
21156  PyTuple_SET_ITEM(__pyx_tuple__14, 0, __pyx_int_neg_1);
21157  __Pyx_GIVEREF(__pyx_tuple__14);
21158 
21159  /* "(tree fragment)":2
21160  * def __reduce_cython__(self):
21161  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
21162  * def __setstate_cython__(self, __pyx_state):
21163  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
21164  */
21165  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(2, 2, __pyx_L1_error)
21166  __Pyx_GOTREF(__pyx_tuple__15);
21167  __Pyx_GIVEREF(__pyx_tuple__15);
21168 
21169  /* "(tree fragment)":4
21170  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
21171  * def __setstate_cython__(self, __pyx_state):
21172  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
21173  */
21174  __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(2, 4, __pyx_L1_error)
21175  __Pyx_GOTREF(__pyx_tuple__16);
21176  __Pyx_GIVEREF(__pyx_tuple__16);
21177 
21178  /* "View.MemoryView":684
21179  * if item is Ellipsis:
21180  * if not seen_ellipsis:
21181  * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
21182  * seen_ellipsis = True
21183  * else:
21184  */
21185  __pyx_slice__17 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__17)) __PYX_ERR(2, 684, __pyx_L1_error)
21186  __Pyx_GOTREF(__pyx_slice__17);
21187  __Pyx_GIVEREF(__pyx_slice__17);
21188 
21189  /* "View.MemoryView":705
21190  * for suboffset in suboffsets[:ndim]:
21191  * if suboffset >= 0:
21192  * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
21193  *
21194  *
21195  */
21196  __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(2, 705, __pyx_L1_error)
21197  __Pyx_GOTREF(__pyx_tuple__18);
21198  __Pyx_GIVEREF(__pyx_tuple__18);
21199 
21200  /* "(tree fragment)":2
21201  * def __reduce_cython__(self):
21202  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
21203  * def __setstate_cython__(self, __pyx_state):
21204  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
21205  */
21206  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(2, 2, __pyx_L1_error)
21207  __Pyx_GOTREF(__pyx_tuple__19);
21208  __Pyx_GIVEREF(__pyx_tuple__19);
21209 
21210  /* "(tree fragment)":4
21211  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
21212  * def __setstate_cython__(self, __pyx_state):
21213  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
21214  */
21215  __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(2, 4, __pyx_L1_error)
21216  __Pyx_GOTREF(__pyx_tuple__20);
21217  __Pyx_GIVEREF(__pyx_tuple__20);
21218  __pyx_tuple__22 = PyTuple_Pack(3, __pyx_int_184977713, __pyx_int_136983863, __pyx_int_112105877); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(2, 4, __pyx_L1_error)
21219  __Pyx_GOTREF(__pyx_tuple__22);
21220  __Pyx_GIVEREF(__pyx_tuple__22);
21221 
21222  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":39
21223  * # ===================
21224  *
21225  * cpdef FlagType pyc_trace_estimator( # <<<<<<<<<<<<<<
21226  * pycLinearOperator Aop,
21227  * parameters,
21228  */
21229  __pyx_tuple__23 = PyTuple_Pack(26, __pyx_n_s_Aop, __pyx_n_s_parameters, __pyx_n_s_num_inquiries, __pyx_n_s_py_matrix_function, __pyx_n_s_gram, __pyx_n_s_exponent, __pyx_n_s_reorthogonalize, __pyx_n_s_seed, __pyx_n_s_lanczos_degree, __pyx_n_s_lanczos_tol, __pyx_n_s_min_num_samples, __pyx_n_s_max_num_samples, __pyx_n_s_error_atol, __pyx_n_s_error_rtol, __pyx_n_s_confidence_level, __pyx_n_s_outlier_significance_level, __pyx_n_s_num_threads, __pyx_n_s_data_type_name, __pyx_n_s_trace, __pyx_n_s_error, __pyx_n_s_samples, __pyx_n_s_processed_samples_indices, __pyx_n_s_num_samples_used, __pyx_n_s_num_outliers, __pyx_n_s_converged, __pyx_n_s_alg_wall_times); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 39, __pyx_L1_error)
21230  __Pyx_GOTREF(__pyx_tuple__23);
21231  __Pyx_GIVEREF(__pyx_tuple__23);
21232  __pyx_codeobj_ = (PyObject*)__Pyx_PyCode_New(26, 0, 26, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_trace_estimator_py_c_tr, __pyx_n_s_pyc_trace_estimator, 39, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj_)) __PYX_ERR(0, 39, __pyx_L1_error)
21233 
21234  /* "View.MemoryView":287
21235  * return self.name
21236  *
21237  * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
21238  * cdef strided = Enum("<strided and direct>") # default
21239  * cdef indirect = Enum("<strided and indirect>")
21240  */
21241  __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(2, 287, __pyx_L1_error)
21242  __Pyx_GOTREF(__pyx_tuple__24);
21243  __Pyx_GIVEREF(__pyx_tuple__24);
21244 
21245  /* "View.MemoryView":288
21246  *
21247  * cdef generic = Enum("<strided and direct or indirect>")
21248  * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
21249  * cdef indirect = Enum("<strided and indirect>")
21250  *
21251  */
21252  __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(2, 288, __pyx_L1_error)
21253  __Pyx_GOTREF(__pyx_tuple__25);
21254  __Pyx_GIVEREF(__pyx_tuple__25);
21255 
21256  /* "View.MemoryView":289
21257  * cdef generic = Enum("<strided and direct or indirect>")
21258  * cdef strided = Enum("<strided and direct>") # default
21259  * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
21260  *
21261  *
21262  */
21263  __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(2, 289, __pyx_L1_error)
21264  __Pyx_GOTREF(__pyx_tuple__26);
21265  __Pyx_GIVEREF(__pyx_tuple__26);
21266 
21267  /* "View.MemoryView":292
21268  *
21269  *
21270  * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
21271  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
21272  *
21273  */
21274  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(2, 292, __pyx_L1_error)
21275  __Pyx_GOTREF(__pyx_tuple__27);
21276  __Pyx_GIVEREF(__pyx_tuple__27);
21277 
21278  /* "View.MemoryView":293
21279  *
21280  * cdef contiguous = Enum("<contiguous and direct>")
21281  * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
21282  *
21283  *
21284  */
21285  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(2, 293, __pyx_L1_error)
21286  __Pyx_GOTREF(__pyx_tuple__28);
21287  __Pyx_GIVEREF(__pyx_tuple__28);
21288 
21289  /* "(tree fragment)":1
21290  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
21291  * cdef object __pyx_PickleError
21292  * cdef object __pyx_result
21293  */
21294  __pyx_tuple__29 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(2, 1, __pyx_L1_error)
21295  __Pyx_GOTREF(__pyx_tuple__29);
21296  __Pyx_GIVEREF(__pyx_tuple__29);
21297  __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(2, 1, __pyx_L1_error)
21298  __Pyx_RefNannyFinishContext();
21299  return 0;
21300  __pyx_L1_error:;
21301  __Pyx_RefNannyFinishContext();
21302  return -1;
21303 }
21304 
21305 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
21306  /* AssertionsEnabled.init */
21307  __Pyx_init_assertions_enabled();
21308 
21309 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
21310 
21311  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21312  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
21313  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
21314  __pyx_int_112105877 = PyInt_FromLong(112105877L); if (unlikely(!__pyx_int_112105877)) __PYX_ERR(0, 1, __pyx_L1_error)
21315  __pyx_int_136983863 = PyInt_FromLong(136983863L); if (unlikely(!__pyx_int_136983863)) __PYX_ERR(0, 1, __pyx_L1_error)
21316  __pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
21317  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
21318  return 0;
21319  __pyx_L1_error:;
21320  return -1;
21321 }
21322 
21323 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
21324 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
21325 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
21326 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
21327 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
21328 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
21329 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
21330 
21331 static int __Pyx_modinit_global_init_code(void) {
21332  __Pyx_RefNannyDeclarations
21333  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
21334  /*--- Global init code ---*/
21335  generic = Py_None; Py_INCREF(Py_None);
21336  strided = Py_None; Py_INCREF(Py_None);
21337  indirect = Py_None; Py_INCREF(Py_None);
21338  contiguous = Py_None; Py_INCREF(Py_None);
21339  indirect_contiguous = Py_None; Py_INCREF(Py_None);
21340  __Pyx_RefNannyFinishContext();
21341  return 0;
21342 }
21343 
21344 static int __Pyx_modinit_variable_export_code(void) {
21345  __Pyx_RefNannyDeclarations
21346  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
21347  /*--- Variable export code ---*/
21348  __Pyx_RefNannyFinishContext();
21349  return 0;
21350 }
21351 
21352 static int __Pyx_modinit_function_export_code(void) {
21353  __Pyx_RefNannyDeclarations
21354  int __pyx_lineno = 0;
21355  const char *__pyx_filename = NULL;
21356  int __pyx_clineno = 0;
21357  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
21358  /*--- Function export code ---*/
21359  if (__Pyx_ExportFunction("pyc_trace_estimator", (void (*)(void))__pyx_f_5imate_18_c_trace_estimator_20py_c_trace_estimator_pyc_trace_estimator, "__pyx_t_5imate_12_definitions_5types_FlagType (struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *, PyObject *, PyObject *, struct __pyx_obj_5imate_9functions_12py_functions_pyFunction *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21360  __Pyx_RefNannyFinishContext();
21361  return 0;
21362  __pyx_L1_error:;
21363  __Pyx_RefNannyFinishContext();
21364  return -1;
21365 }
21366 
21367 static int __Pyx_modinit_type_init_code(void) {
21368  __Pyx_RefNannyDeclarations
21369  int __pyx_lineno = 0;
21370  const char *__pyx_filename = NULL;
21371  int __pyx_clineno = 0;
21372  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
21373  /*--- Type init code ---*/
21374  __pyx_vtabptr_array = &__pyx_vtable_array;
21375  __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
21376  if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(2, 106, __pyx_L1_error)
21377  #if PY_VERSION_HEX < 0x030800B1
21378  __pyx_type___pyx_array.tp_print = 0;
21379  #endif
21380  if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(2, 106, __pyx_L1_error)
21381  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(2, 106, __pyx_L1_error)
21382  __pyx_array_type = &__pyx_type___pyx_array;
21383  if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 280, __pyx_L1_error)
21384  #if PY_VERSION_HEX < 0x030800B1
21385  __pyx_type___pyx_MemviewEnum.tp_print = 0;
21386  #endif
21387  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
21388  __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
21389  }
21390  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 280, __pyx_L1_error)
21391  __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
21392  __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
21393  __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
21394  __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
21395  __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
21396  __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
21397  __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
21398  __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object;
21399  __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object;
21400  if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(2, 331, __pyx_L1_error)
21401  #if PY_VERSION_HEX < 0x030800B1
21402  __pyx_type___pyx_memoryview.tp_print = 0;
21403  #endif
21404  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
21405  __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
21406  }
21407  if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(2, 331, __pyx_L1_error)
21408  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(2, 331, __pyx_L1_error)
21409  __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
21410  __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
21411  __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
21412  __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object;
21413  __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
21414  __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
21415  if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 967, __pyx_L1_error)
21416  #if PY_VERSION_HEX < 0x030800B1
21417  __pyx_type___pyx_memoryviewslice.tp_print = 0;
21418  #endif
21419  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
21420  __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
21421  }
21422  if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(2, 967, __pyx_L1_error)
21423  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 967, __pyx_L1_error)
21424  __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
21425  __Pyx_RefNannyFinishContext();
21426  return 0;
21427  __pyx_L1_error:;
21428  __Pyx_RefNannyFinishContext();
21429  return -1;
21430 }
21431 
21432 static int __Pyx_modinit_type_import_code(void) {
21433  __Pyx_RefNannyDeclarations
21434  PyObject *__pyx_t_1 = NULL;
21435  int __pyx_lineno = 0;
21436  const char *__pyx_filename = NULL;
21437  int __pyx_clineno = 0;
21438  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
21439  /*--- Type import code ---*/
21440  __pyx_t_1 = PyImport_ImportModule("imate.functions.py_functions"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 20, __pyx_L1_error)
21441  __Pyx_GOTREF(__pyx_t_1);
21442  __pyx_ptype_5imate_9functions_12py_functions_pyFunction = __Pyx_ImportType_0_29_36(__pyx_t_1, "imate.functions.py_functions", "pyFunction", sizeof(struct __pyx_obj_5imate_9functions_12py_functions_pyFunction), __PYX_GET_STRUCT_ALIGNMENT_0_29_36(struct __pyx_obj_5imate_9functions_12py_functions_pyFunction),__Pyx_ImportType_CheckSize_Warn_0_29_36); if (!__pyx_ptype_5imate_9functions_12py_functions_pyFunction) __PYX_ERR(3, 20, __pyx_L1_error)
21443  __pyx_vtabptr_5imate_9functions_12py_functions_pyFunction = (struct __pyx_vtabstruct_5imate_9functions_12py_functions_pyFunction*)__Pyx_GetVtable(__pyx_ptype_5imate_9functions_12py_functions_pyFunction->tp_dict); if (unlikely(!__pyx_vtabptr_5imate_9functions_12py_functions_pyFunction)) __PYX_ERR(3, 20, __pyx_L1_error)
21444  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21445  __pyx_t_1 = PyImport_ImportModule("imate._c_linear_operator.py_c_linear_operator"); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 23, __pyx_L1_error)
21446  __Pyx_GOTREF(__pyx_t_1);
21447  __pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator = __Pyx_ImportType_0_29_36(__pyx_t_1, "imate._c_linear_operator.py_c_linear_operator", "pycLinearOperator", sizeof(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator), __PYX_GET_STRUCT_ALIGNMENT_0_29_36(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator),__Pyx_ImportType_CheckSize_Warn_0_29_36); if (!__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator) __PYX_ERR(4, 23, __pyx_L1_error)
21448  __pyx_vtabptr_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator = (struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator*)__Pyx_GetVtable(__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_dict); if (unlikely(!__pyx_vtabptr_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator)) __PYX_ERR(4, 23, __pyx_L1_error)
21449  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21450  __pyx_t_1 = PyImport_ImportModule("imate._c_linear_operator.py_c_matrix"); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 21, __pyx_L1_error)
21451  __Pyx_GOTREF(__pyx_t_1);
21452  __pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix = __Pyx_ImportType_0_29_36(__pyx_t_1, "imate._c_linear_operator.py_c_matrix", "pycMatrix", sizeof(struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix), __PYX_GET_STRUCT_ALIGNMENT_0_29_36(struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix),__Pyx_ImportType_CheckSize_Warn_0_29_36); if (!__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix) __PYX_ERR(5, 21, __pyx_L1_error)
21453  __pyx_vtabptr_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix = (struct __pyx_vtabstruct_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix*)__Pyx_GetVtable(__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix->tp_dict); if (unlikely(!__pyx_vtabptr_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix)) __PYX_ERR(5, 21, __pyx_L1_error)
21454  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21455  __pyx_t_1 = PyImport_ImportModule("imate._c_linear_operator.py_c_affine_matrix_function"); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 21, __pyx_L1_error)
21456  __Pyx_GOTREF(__pyx_t_1);
21457  __pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction = __Pyx_ImportType_0_29_36(__pyx_t_1, "imate._c_linear_operator.py_c_affine_matrix_function", "pycAffineMatrixFunction", sizeof(struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction), __PYX_GET_STRUCT_ALIGNMENT_0_29_36(struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction),__Pyx_ImportType_CheckSize_Warn_0_29_36); if (!__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction) __PYX_ERR(6, 21, __pyx_L1_error)
21458  __pyx_vtabptr_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction = (struct __pyx_vtabstruct_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction*)__Pyx_GetVtable(__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction->tp_dict); if (unlikely(!__pyx_vtabptr_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction)) __PYX_ERR(6, 21, __pyx_L1_error)
21459  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21460  __Pyx_RefNannyFinishContext();
21461  return 0;
21462  __pyx_L1_error:;
21463  __Pyx_XDECREF(__pyx_t_1);
21464  __Pyx_RefNannyFinishContext();
21465  return -1;
21466 }
21467 
21468 static int __Pyx_modinit_variable_import_code(void) {
21469  __Pyx_RefNannyDeclarations
21470  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
21471  /*--- Variable import code ---*/
21472  __Pyx_RefNannyFinishContext();
21473  return 0;
21474 }
21475 
21476 static int __Pyx_modinit_function_import_code(void) {
21477  __Pyx_RefNannyDeclarations
21478  PyObject *__pyx_t_1 = NULL;
21479  int __pyx_lineno = 0;
21480  const char *__pyx_filename = NULL;
21481  int __pyx_clineno = 0;
21482  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
21483  /*--- Function import code ---*/
21484  __pyx_t_1 = PyImport_ImportModule("scipy.linalg.cython_lapack"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
21485  __Pyx_GOTREF(__pyx_t_1);
21486  if (__Pyx_ImportFunction_0_29_36(__pyx_t_1, "dbdsdc", (void (**)(void))&__pyx_f_5scipy_6linalg_13cython_lapack_dbdsdc, "void (char *, char *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, int *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21487  if (__Pyx_ImportFunction_0_29_36(__pyx_t_1, "dstev", (void (**)(void))&__pyx_f_5scipy_6linalg_13cython_lapack_dstev, "void (char *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21488  if (__Pyx_ImportFunction_0_29_36(__pyx_t_1, "sbdsdc", (void (**)(void))&__pyx_f_5scipy_6linalg_13cython_lapack_sbdsdc, "void (char *, char *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, int *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21489  if (__Pyx_ImportFunction_0_29_36(__pyx_t_1, "sstev", (void (**)(void))&__pyx_f_5scipy_6linalg_13cython_lapack_sstev, "void (char *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21490  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21491  __Pyx_RefNannyFinishContext();
21492  return 0;
21493  __pyx_L1_error:;
21494  __Pyx_XDECREF(__pyx_t_1);
21495  __Pyx_RefNannyFinishContext();
21496  return -1;
21497 }
21498 
21499 
21500 #ifndef CYTHON_NO_PYINIT_EXPORT
21501 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
21502 #elif PY_MAJOR_VERSION < 3
21503 #ifdef __cplusplus
21504 #define __Pyx_PyMODINIT_FUNC extern "C" void
21505 #else
21506 #define __Pyx_PyMODINIT_FUNC void
21507 #endif
21508 #else
21509 #ifdef __cplusplus
21510 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
21511 #else
21512 #define __Pyx_PyMODINIT_FUNC PyObject *
21513 #endif
21514 #endif
21515 
21516 
21517 #if PY_MAJOR_VERSION < 3
21518 __Pyx_PyMODINIT_FUNC initpy_c_trace_estimator(void) CYTHON_SMALL_CODE; /*proto*/
21519 __Pyx_PyMODINIT_FUNC initpy_c_trace_estimator(void)
21520 #else
21521 __Pyx_PyMODINIT_FUNC PyInit_py_c_trace_estimator(void) CYTHON_SMALL_CODE; /*proto*/
21522 __Pyx_PyMODINIT_FUNC PyInit_py_c_trace_estimator(void)
21523 #if CYTHON_PEP489_MULTI_PHASE_INIT
21524 {
21525  return PyModuleDef_Init(&__pyx_moduledef);
21526 }
21527 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
21528  #if PY_VERSION_HEX >= 0x030700A1
21529  static PY_INT64_T main_interpreter_id = -1;
21530  PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
21531  if (main_interpreter_id == -1) {
21532  main_interpreter_id = current_id;
21533  return (unlikely(current_id == -1)) ? -1 : 0;
21534  } else if (unlikely(main_interpreter_id != current_id))
21535  #else
21536  static PyInterpreterState *main_interpreter = NULL;
21537  PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
21538  if (!main_interpreter) {
21539  main_interpreter = current_interpreter;
21540  } else if (unlikely(main_interpreter != current_interpreter))
21541  #endif
21542  {
21543  PyErr_SetString(
21544  PyExc_ImportError,
21545  "Interpreter change detected - this module can only be loaded into one interpreter per process.");
21546  return -1;
21547  }
21548  return 0;
21549 }
21550 static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) {
21551  PyObject *value = PyObject_GetAttrString(spec, from_name);
21552  int result = 0;
21553  if (likely(value)) {
21554  if (allow_none || value != Py_None) {
21555  result = PyDict_SetItemString(moddict, to_name, value);
21556  }
21557  Py_DECREF(value);
21558  } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
21559  PyErr_Clear();
21560  } else {
21561  result = -1;
21562  }
21563  return result;
21564 }
21565 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
21566  PyObject *module = NULL, *moddict, *modname;
21567  if (__Pyx_check_single_interpreter())
21568  return NULL;
21569  if (__pyx_m)
21570  return __Pyx_NewRef(__pyx_m);
21571  modname = PyObject_GetAttrString(spec, "name");
21572  if (unlikely(!modname)) goto bad;
21573  module = PyModule_NewObject(modname);
21574  Py_DECREF(modname);
21575  if (unlikely(!module)) goto bad;
21576  moddict = PyModule_GetDict(module);
21577  if (unlikely(!moddict)) goto bad;
21578  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
21579  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
21580  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
21581  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
21582  return module;
21583 bad:
21584  Py_XDECREF(module);
21585  return NULL;
21586 }
21587 
21588 
21589 static CYTHON_SMALL_CODE int __pyx_pymod_exec_py_c_trace_estimator(PyObject *__pyx_pyinit_module)
21590 #endif
21591 #endif
21592 {
21593  __Pyx_TraceDeclarations
21594  PyObject *__pyx_t_1 = NULL;
21595  static PyThread_type_lock __pyx_t_2[8];
21596  int __pyx_lineno = 0;
21597  const char *__pyx_filename = NULL;
21598  int __pyx_clineno = 0;
21599  __Pyx_RefNannyDeclarations
21600  #if CYTHON_PEP489_MULTI_PHASE_INIT
21601  if (__pyx_m) {
21602  if (__pyx_m == __pyx_pyinit_module) return 0;
21603  PyErr_SetString(PyExc_RuntimeError, "Module 'py_c_trace_estimator' has already been imported. Re-initialisation is not supported.");
21604  return -1;
21605  }
21606  #elif PY_MAJOR_VERSION >= 3
21607  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
21608  #endif
21609  #if CYTHON_REFNANNY
21610 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
21611 if (!__Pyx_RefNanny) {
21612  PyErr_Clear();
21613  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
21614  if (!__Pyx_RefNanny)
21615  Py_FatalError("failed to import 'refnanny' module");
21616 }
21617 #endif
21618  __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_py_c_trace_estimator(void)", 0);
21619  if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21620  #ifdef __Pxy_PyFrame_Initialize_Offsets
21621  __Pxy_PyFrame_Initialize_Offsets();
21622  #endif
21623  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
21624  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
21625  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
21626  #ifdef __Pyx_CyFunction_USED
21627  if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21628  #endif
21629  #ifdef __Pyx_FusedFunction_USED
21630  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21631  #endif
21632  #ifdef __Pyx_Coroutine_USED
21633  if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21634  #endif
21635  #ifdef __Pyx_Generator_USED
21636  if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21637  #endif
21638  #ifdef __Pyx_AsyncGen_USED
21639  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21640  #endif
21641  #ifdef __Pyx_StopAsyncIteration_USED
21642  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21643  #endif
21644  /*--- Library function declarations ---*/
21645  /*--- Threads initialization code ---*/
21646  #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
21647  PyEval_InitThreads();
21648  #endif
21649  /*--- Module creation code ---*/
21650  #if CYTHON_PEP489_MULTI_PHASE_INIT
21651  __pyx_m = __pyx_pyinit_module;
21652  Py_INCREF(__pyx_m);
21653  #else
21654  #if PY_MAJOR_VERSION < 3
21655  __pyx_m = Py_InitModule4("py_c_trace_estimator", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
21656  #else
21657  __pyx_m = PyModule_Create(&__pyx_moduledef);
21658  #endif
21659  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
21660  #endif
21661  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
21662  Py_INCREF(__pyx_d);
21663  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
21664  Py_INCREF(__pyx_b);
21665  __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
21666  Py_INCREF(__pyx_cython_runtime);
21667  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21668  /*--- Initialize various global constants etc. ---*/
21669  if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21670  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
21671  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21672  #endif
21673  if (__pyx_module_is_main_imate___c_trace_estimator__py_c_trace_estimator) {
21674  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21675  }
21676  #if PY_MAJOR_VERSION >= 3
21677  {
21678  PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
21679  if (!PyDict_GetItemString(modules, "imate._c_trace_estimator.py_c_trace_estimator")) {
21680  if (unlikely(PyDict_SetItemString(modules, "imate._c_trace_estimator.py_c_trace_estimator", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
21681  }
21682  }
21683  #endif
21684  /*--- Builtin init code ---*/
21685  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21686  /*--- Constants init code ---*/
21687  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21688  /*--- Global type/function init code ---*/
21689  (void)__Pyx_modinit_global_init_code();
21690  (void)__Pyx_modinit_variable_export_code();
21691  if (unlikely(__Pyx_modinit_function_export_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
21692  if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
21693  if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
21694  (void)__Pyx_modinit_variable_import_code();
21695  if (unlikely(__Pyx_modinit_function_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
21696  /*--- Execution code ---*/
21697  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
21698  if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21699  #endif
21700  __Pyx_TraceCall("__Pyx_PyMODINIT_FUNC PyInit_py_c_trace_estimator(void)", __pyx_f[0], 1, 0, __PYX_ERR(0, 1, __pyx_L1_error));
21701 
21702  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":15
21703  *
21704  * # Python
21705  * import numpy # <<<<<<<<<<<<<<
21706  *
21707  * # Cython
21708  */
21709  __Pyx_TraceLine(15,0,__PYX_ERR(0, 15, __pyx_L1_error))
21710  __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
21711  __Pyx_GOTREF(__pyx_t_1);
21712  if (PyDict_SetItem(__pyx_d, __pyx_n_s_numpy, __pyx_t_1) < 0) __PYX_ERR(0, 15, __pyx_L1_error)
21713  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21714 
21715  /* "imate/_c_trace_estimator/lapack_api.pxi":21
21716  * # ============
21717  *
21718  * cdef public void lapack_sstev(char* jobz, int* n, float* d, float* e, float* z, # <<<<<<<<<<<<<<
21719  * int* ldz, float* work, int* info) nogil:
21720  * """
21721  */
21722  __Pyx_TraceLine(21,0,__PYX_ERR(1, 21, __pyx_L1_error))
21723 
21724 
21725  /* "imate/_c_trace_estimator/lapack_api.pxi":41
21726  * # ============
21727  *
21728  * cdef public void lapack_dstev(char* jobz, int* n, double* d, double* e, # <<<<<<<<<<<<<<
21729  * double* z, int* ldz, double* work,
21730  * int* info) nogil:
21731  */
21732  __Pyx_TraceLine(41,0,__PYX_ERR(1, 41, __pyx_L1_error))
21733 
21734 
21735  /* "imate/_c_trace_estimator/lapack_api.pxi":62
21736  * # =============
21737  *
21738  * cdef public void lapack_sbdsdc(char* uplo, char* compq, int* n, float* d, # <<<<<<<<<<<<<<
21739  * float *e, float* u, int* ldu, float* vt,
21740  * int* ldvt, float* q, int* iq, float* work,
21741  */
21742  __Pyx_TraceLine(62,0,__PYX_ERR(1, 62, __pyx_L1_error))
21743 
21744 
21745  /* "imate/_c_trace_estimator/lapack_api.pxi":84
21746  * # =============
21747  *
21748  * cdef public void lapack_dbdsdc(char* uplo, char* compq, int* n, double* d, # <<<<<<<<<<<<<<
21749  * double *e, double* u, int* ldu, double* vt,
21750  * int* ldvt, double* q, int* iq, double* work,
21751  */
21752  __Pyx_TraceLine(84,0,__PYX_ERR(1, 84, __pyx_L1_error))
21753 
21754 
21755  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":39
21756  * # ===================
21757  *
21758  * cpdef FlagType pyc_trace_estimator( # <<<<<<<<<<<<<<
21759  * pycLinearOperator Aop,
21760  * parameters,
21761  */
21762  __Pyx_TraceLine(39,0,__PYX_ERR(0, 39, __pyx_L1_error))
21763 
21764  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_trace_estimator_20py_c_trace_estimator_1pyc_trace_estimator, 0, __pyx_n_s_pyc_trace_estimator, NULL, __pyx_n_s_imate__c_trace_estimator_py_c_tr_2, __pyx_d, ((PyObject *)__pyx_codeobj_)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error)
21765  __Pyx_GOTREF(__pyx_t_1);
21766  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyc_trace_estimator, __pyx_t_1) < 0) __PYX_ERR(0, 39, __pyx_L1_error)
21767  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21768 
21769  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":173
21770  * # =========================
21771  *
21772  * cdef FlagType _pyc_trace_estimator_float( # <<<<<<<<<<<<<<
21773  * pycLinearOperator Aop,
21774  * parameters,
21775  */
21776  __Pyx_TraceLine(173,0,__PYX_ERR(0, 173, __pyx_L1_error))
21777 
21778 
21779  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":290
21780  * # ==========================
21781  *
21782  * cdef FlagType _pyc_trace_estimator_double( # <<<<<<<<<<<<<<
21783  * pycLinearOperator Aop,
21784  * parameters,
21785  */
21786  __Pyx_TraceLine(290,0,__PYX_ERR(0, 290, __pyx_L1_error))
21787 
21788 
21789  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":407
21790  * # ===============================
21791  *
21792  * cdef FlagType _pyc_trace_estimator_long_double( # <<<<<<<<<<<<<<
21793  * pycLinearOperator Aop,
21794  * parameters,
21795  */
21796  __Pyx_TraceLine(407,0,__PYX_ERR(0, 407, __pyx_L1_error))
21797 
21798 
21799  /* "imate/_c_trace_estimator/py_c_trace_estimator.pyx":1
21800  * # SPDX-FileCopyrightText: Copyright 2021, Siavash Ameli <sameli@berkeley.edu> # <<<<<<<<<<<<<<
21801  * # SPDX-License-Identifier: BSD-3-Clause
21802  * # SPDX-FileType: SOURCE
21803  */
21804  __Pyx_TraceLine(1,0,__PYX_ERR(0, 1, __pyx_L1_error))
21805  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
21806  __Pyx_GOTREF(__pyx_t_1);
21807  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21808  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21809 
21810  /* "View.MemoryView":210
21811  * info.obj = self
21812  *
21813  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
21814  *
21815  * def __dealloc__(array self):
21816  */
21817  __Pyx_TraceLine(210,0,__PYX_ERR(2, 210, __pyx_L1_error))
21818  __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 210, __pyx_L1_error)
21819  __Pyx_GOTREF(__pyx_t_1);
21820  if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(2, 210, __pyx_L1_error)
21821  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21822  PyType_Modified(__pyx_array_type);
21823 
21824  /* "View.MemoryView":227
21825  *
21826  * @cname('get_memview')
21827  * cdef get_memview(self): # <<<<<<<<<<<<<<
21828  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
21829  * return memoryview(self, flags, self.dtype_is_object)
21830  */
21831  __Pyx_TraceLine(227,0,__PYX_ERR(2, 227, __pyx_L1_error))
21832 
21833 
21834  /* "View.MemoryView":245
21835  *
21836  * @cname("__pyx_array_new")
21837  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
21838  * char *mode, char *buf):
21839  * cdef array result
21840  */
21841  __Pyx_TraceLine(245,0,__PYX_ERR(2, 245, __pyx_L1_error))
21842 
21843 
21844  /* "View.MemoryView":287
21845  * return self.name
21846  *
21847  * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
21848  * cdef strided = Enum("<strided and direct>") # default
21849  * cdef indirect = Enum("<strided and indirect>")
21850  */
21851  __Pyx_TraceLine(287,0,__PYX_ERR(2, 287, __pyx_L1_error))
21852  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 287, __pyx_L1_error)
21853  __Pyx_GOTREF(__pyx_t_1);
21854  __Pyx_XGOTREF(generic);
21855  __Pyx_DECREF_SET(generic, __pyx_t_1);
21856  __Pyx_GIVEREF(__pyx_t_1);
21857  __pyx_t_1 = 0;
21858 
21859  /* "View.MemoryView":288
21860  *
21861  * cdef generic = Enum("<strided and direct or indirect>")
21862  * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
21863  * cdef indirect = Enum("<strided and indirect>")
21864  *
21865  */
21866  __Pyx_TraceLine(288,0,__PYX_ERR(2, 288, __pyx_L1_error))
21867  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 288, __pyx_L1_error)
21868  __Pyx_GOTREF(__pyx_t_1);
21869  __Pyx_XGOTREF(strided);
21870  __Pyx_DECREF_SET(strided, __pyx_t_1);
21871  __Pyx_GIVEREF(__pyx_t_1);
21872  __pyx_t_1 = 0;
21873 
21874  /* "View.MemoryView":289
21875  * cdef generic = Enum("<strided and direct or indirect>")
21876  * cdef strided = Enum("<strided and direct>") # default
21877  * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
21878  *
21879  *
21880  */
21881  __Pyx_TraceLine(289,0,__PYX_ERR(2, 289, __pyx_L1_error))
21882  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 289, __pyx_L1_error)
21883  __Pyx_GOTREF(__pyx_t_1);
21884  __Pyx_XGOTREF(indirect);
21885  __Pyx_DECREF_SET(indirect, __pyx_t_1);
21886  __Pyx_GIVEREF(__pyx_t_1);
21887  __pyx_t_1 = 0;
21888 
21889  /* "View.MemoryView":292
21890  *
21891  *
21892  * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
21893  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
21894  *
21895  */
21896  __Pyx_TraceLine(292,0,__PYX_ERR(2, 292, __pyx_L1_error))
21897  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 292, __pyx_L1_error)
21898  __Pyx_GOTREF(__pyx_t_1);
21899  __Pyx_XGOTREF(contiguous);
21900  __Pyx_DECREF_SET(contiguous, __pyx_t_1);
21901  __Pyx_GIVEREF(__pyx_t_1);
21902  __pyx_t_1 = 0;
21903 
21904  /* "View.MemoryView":293
21905  *
21906  * cdef contiguous = Enum("<contiguous and direct>")
21907  * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
21908  *
21909  *
21910  */
21911  __Pyx_TraceLine(293,0,__PYX_ERR(2, 293, __pyx_L1_error))
21912  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 293, __pyx_L1_error)
21913  __Pyx_GOTREF(__pyx_t_1);
21914  __Pyx_XGOTREF(indirect_contiguous);
21915  __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_1);
21916  __Pyx_GIVEREF(__pyx_t_1);
21917  __pyx_t_1 = 0;
21918 
21919  /* "View.MemoryView":299
21920  *
21921  * @cname('__pyx_align_pointer')
21922  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
21923  * "Align pointer memory on a given boundary"
21924  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
21925  */
21926  __Pyx_TraceLine(299,0,__PYX_ERR(2, 299, __pyx_L1_error))
21927 
21928 
21929  /* "View.MemoryView":317
21930  *
21931  * DEF THREAD_LOCKS_PREALLOCATED = 8
21932  * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<<
21933  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [
21934  * PyThread_allocate_lock(),
21935  */
21936  __Pyx_TraceLine(317,0,__PYX_ERR(2, 317, __pyx_L1_error))
21937  __pyx_memoryview_thread_locks_used = 0;
21938 
21939  /* "View.MemoryView":318
21940  * DEF THREAD_LOCKS_PREALLOCATED = 8
21941  * cdef int __pyx_memoryview_thread_locks_used = 0
21942  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<<
21943  * PyThread_allocate_lock(),
21944  * PyThread_allocate_lock(),
21945  */
21946  __Pyx_TraceLine(318,0,__PYX_ERR(2, 318, __pyx_L1_error))
21947  __pyx_t_2[0] = PyThread_allocate_lock();
21948  __pyx_t_2[1] = PyThread_allocate_lock();
21949  __pyx_t_2[2] = PyThread_allocate_lock();
21950  __pyx_t_2[3] = PyThread_allocate_lock();
21951  __pyx_t_2[4] = PyThread_allocate_lock();
21952  __pyx_t_2[5] = PyThread_allocate_lock();
21953  __pyx_t_2[6] = PyThread_allocate_lock();
21954  __pyx_t_2[7] = PyThread_allocate_lock();
21955  memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_2, sizeof(__pyx_memoryview_thread_locks[0]) * (8));
21956 
21957  /* "View.MemoryView":395
21958  * PyThread_free_lock(self.lock)
21959  *
21960  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
21961  * cdef Py_ssize_t dim
21962  * cdef char *itemp = <char *> self.view.buf
21963  */
21964  __Pyx_TraceLine(395,0,__PYX_ERR(2, 395, __pyx_L1_error))
21965 
21966 
21967  /* "View.MemoryView":433
21968  * self.setitem_indexed(index, value)
21969  *
21970  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
21971  * if not isinstance(obj, memoryview):
21972  * try:
21973  */
21974  __Pyx_TraceLine(433,0,__PYX_ERR(2, 433, __pyx_L1_error))
21975 
21976 
21977  /* "View.MemoryView":443
21978  * return obj
21979  *
21980  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
21981  * cdef __Pyx_memviewslice dst_slice
21982  * cdef __Pyx_memviewslice src_slice
21983  */
21984  __Pyx_TraceLine(443,0,__PYX_ERR(2, 443, __pyx_L1_error))
21985 
21986 
21987  /* "View.MemoryView":451
21988  * src.ndim, dst.ndim, self.dtype_is_object)
21989  *
21990  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
21991  * cdef int array[128]
21992  * cdef void *tmp = NULL
21993  */
21994  __Pyx_TraceLine(451,0,__PYX_ERR(2, 451, __pyx_L1_error))
21995 
21996 
21997  /* "View.MemoryView":483
21998  * PyMem_Free(tmp)
21999  *
22000  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
22001  * cdef char *itemp = self.get_item_pointer(index)
22002  * self.assign_item_from_object(itemp, value)
22003  */
22004  __Pyx_TraceLine(483,0,__PYX_ERR(2, 483, __pyx_L1_error))
22005 
22006 
22007  /* "View.MemoryView":487
22008  * self.assign_item_from_object(itemp, value)
22009  *
22010  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
22011  * """Only used if instantiated manually by the user, or if Cython doesn't
22012  * know how to convert the type"""
22013  */
22014  __Pyx_TraceLine(487,0,__PYX_ERR(2, 487, __pyx_L1_error))
22015 
22016 
22017  /* "View.MemoryView":503
22018  * return result
22019  *
22020  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
22021  * """Only used if instantiated manually by the user, or if Cython doesn't
22022  * know how to convert the type"""
22023  */
22024  __Pyx_TraceLine(503,0,__PYX_ERR(2, 503, __pyx_L1_error))
22025 
22026 
22027  /* "View.MemoryView":551
22028  * info.obj = self
22029  *
22030  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
22031  *
22032  *
22033  */
22034  __Pyx_TraceLine(551,0,__PYX_ERR(2, 551, __pyx_L1_error))
22035  __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 551, __pyx_L1_error)
22036  __Pyx_GOTREF(__pyx_t_1);
22037  if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(2, 551, __pyx_L1_error)
22038  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22039  PyType_Modified(__pyx_memoryview_type);
22040 
22041  /* "View.MemoryView":659
22042  *
22043  * @cname('__pyx_memoryview_new')
22044  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
22045  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
22046  * result.typeinfo = typeinfo
22047  */
22048  __Pyx_TraceLine(659,0,__PYX_ERR(2, 659, __pyx_L1_error))
22049 
22050 
22051  /* "View.MemoryView":665
22052  *
22053  * @cname('__pyx_memoryview_check')
22054  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
22055  * return isinstance(o, memoryview)
22056  *
22057  */
22058  __Pyx_TraceLine(665,0,__PYX_ERR(2, 665, __pyx_L1_error))
22059 
22060 
22061  /* "View.MemoryView":668
22062  * return isinstance(o, memoryview)
22063  *
22064  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
22065  * """
22066  * Replace all ellipses with full slices and fill incomplete indices with
22067  */
22068  __Pyx_TraceLine(668,0,__PYX_ERR(2, 668, __pyx_L1_error))
22069 
22070 
22071  /* "View.MemoryView":702
22072  * return have_slices or nslices, tuple(result)
22073  *
22074  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
22075  * for suboffset in suboffsets[:ndim]:
22076  * if suboffset >= 0:
22077  */
22078  __Pyx_TraceLine(702,0,__PYX_ERR(2, 702, __pyx_L1_error))
22079 
22080 
22081  /* "View.MemoryView":712
22082  *
22083  * @cname('__pyx_memview_slice')
22084  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
22085  * cdef int new_ndim = 0, suboffset_dim = -1, dim
22086  * cdef bint negative_step
22087  */
22088  __Pyx_TraceLine(712,0,__PYX_ERR(2, 712, __pyx_L1_error))
22089 
22090 
22091  /* "View.MemoryView":809
22092  *
22093  * @cname('__pyx_memoryview_slice_memviewslice')
22094  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
22095  * __Pyx_memviewslice *dst,
22096  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
22097  */
22098  __Pyx_TraceLine(809,0,__PYX_ERR(2, 809, __pyx_L1_error))
22099 
22100 
22101  /* "View.MemoryView":912
22102  *
22103  * @cname('__pyx_pybuffer_index')
22104  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
22105  * Py_ssize_t dim) except NULL:
22106  * cdef Py_ssize_t shape, stride, suboffset = -1
22107  */
22108  __Pyx_TraceLine(912,0,__PYX_ERR(2, 912, __pyx_L1_error))
22109 
22110 
22111  /* "View.MemoryView":945
22112  *
22113  * @cname('__pyx_memslice_transpose')
22114  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
22115  * cdef int ndim = memslice.memview.view.ndim
22116  *
22117  */
22118  __Pyx_TraceLine(945,0,__PYX_ERR(2, 945, __pyx_L1_error))
22119 
22120 
22121  /* "View.MemoryView":981
22122  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
22123  *
22124  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
22125  * if self.to_object_func != NULL:
22126  * return self.to_object_func(itemp)
22127  */
22128  __Pyx_TraceLine(981,0,__PYX_ERR(2, 981, __pyx_L1_error))
22129 
22130 
22131  /* "View.MemoryView":987
22132  * return memoryview.convert_item_to_object(self, itemp)
22133  *
22134  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
22135  * if self.to_dtype_func != NULL:
22136  * self.to_dtype_func(itemp, value)
22137  */
22138  __Pyx_TraceLine(987,0,__PYX_ERR(2, 987, __pyx_L1_error))
22139 
22140 
22141  /* "View.MemoryView":997
22142  * return self.from_object
22143  *
22144  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
22145  *
22146  *
22147  */
22148  __Pyx_TraceLine(997,0,__PYX_ERR(2, 997, __pyx_L1_error))
22149  __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 997, __pyx_L1_error)
22150  __Pyx_GOTREF(__pyx_t_1);
22151  if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(2, 997, __pyx_L1_error)
22152  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22153  PyType_Modified(__pyx_memoryviewslice_type);
22154 
22155  /* "View.MemoryView":1001
22156  *
22157  * @cname('__pyx_memoryview_fromslice')
22158  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
22159  * int ndim,
22160  * object (*to_object_func)(char *),
22161  */
22162  __Pyx_TraceLine(1001,0,__PYX_ERR(2, 1001, __pyx_L1_error))
22163 
22164 
22165  /* "View.MemoryView":1054
22166  *
22167  * @cname('__pyx_memoryview_get_slice_from_memoryview')
22168  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
22169  * __Pyx_memviewslice *mslice) except NULL:
22170  * cdef _memoryviewslice obj
22171  */
22172  __Pyx_TraceLine(1054,0,__PYX_ERR(2, 1054, __pyx_L1_error))
22173 
22174 
22175  /* "View.MemoryView":1065
22176  *
22177  * @cname('__pyx_memoryview_slice_copy')
22178  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
22179  * cdef int dim
22180  * cdef (Py_ssize_t*) shape, strides, suboffsets
22181  */
22182  __Pyx_TraceLine(1065,0,__PYX_ERR(2, 1065, __pyx_L1_error))
22183 
22184 
22185  /* "View.MemoryView":1082
22186  *
22187  * @cname('__pyx_memoryview_copy_object')
22188  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
22189  * "Create a new memoryview object"
22190  * cdef __Pyx_memviewslice memviewslice
22191  */
22192  __Pyx_TraceLine(1082,0,__PYX_ERR(2, 1082, __pyx_L1_error))
22193 
22194 
22195  /* "View.MemoryView":1089
22196  *
22197  * @cname('__pyx_memoryview_copy_object_from_slice')
22198  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
22199  * """
22200  * Create a new memoryview object from a given memoryview object and slice.
22201  */
22202  __Pyx_TraceLine(1089,0,__PYX_ERR(2, 1089, __pyx_L1_error))
22203 
22204 
22205  /* "View.MemoryView":1111
22206  *
22207  *
22208  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
22209  * if arg < 0:
22210  * return -arg
22211  */
22212  __Pyx_TraceLine(1111,0,__PYX_ERR(2, 1111, __pyx_L1_error))
22213 
22214 
22215  /* "View.MemoryView":1118
22216  *
22217  * @cname('__pyx_get_best_slice_order')
22218  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
22219  * """
22220  * Figure out the best memory access order for a given slice.
22221  */
22222  __Pyx_TraceLine(1118,0,__PYX_ERR(2, 1118, __pyx_L1_error))
22223 
22224 
22225  /* "View.MemoryView":1172
22226  * dst_data += dst_stride
22227  *
22228  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
22229  * __Pyx_memviewslice *dst,
22230  * int ndim, size_t itemsize) nogil:
22231  */
22232  __Pyx_TraceLine(1172,0,__PYX_ERR(2, 1172, __pyx_L1_error))
22233 
22234 
22235  /* "View.MemoryView":1179
22236  *
22237  * @cname('__pyx_memoryview_slice_get_size')
22238  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
22239  * "Return the size of the memory occupied by the slice in number of bytes"
22240  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
22241  */
22242  __Pyx_TraceLine(1179,0,__PYX_ERR(2, 1179, __pyx_L1_error))
22243 
22244 
22245  /* "View.MemoryView":1189
22246  *
22247  * @cname('__pyx_fill_contig_strides_array')
22248  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
22249  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
22250  * int ndim, char order) nogil:
22251  */
22252  __Pyx_TraceLine(1189,0,__PYX_ERR(2, 1189, __pyx_L1_error))
22253 
22254 
22255  /* "View.MemoryView":1210
22256  *
22257  * @cname('__pyx_memoryview_copy_data_to_temp')
22258  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
22259  * __Pyx_memviewslice *tmpslice,
22260  * char order,
22261  */
22262  __Pyx_TraceLine(1210,0,__PYX_ERR(2, 1210, __pyx_L1_error))
22263 
22264 
22265  /* "View.MemoryView":1253
22266  *
22267  * @cname('__pyx_memoryview_err_extents')
22268  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
22269  * Py_ssize_t extent2) except -1 with gil:
22270  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
22271  */
22272  __Pyx_TraceLine(1253,0,__PYX_ERR(2, 1253, __pyx_L1_error))
22273 
22274 
22275  /* "View.MemoryView":1259
22276  *
22277  * @cname('__pyx_memoryview_err_dim')
22278  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
22279  * raise error(msg.decode('ascii') % dim)
22280  *
22281  */
22282  __Pyx_TraceLine(1259,0,__PYX_ERR(2, 1259, __pyx_L1_error))
22283 
22284 
22285  /* "View.MemoryView":1263
22286  *
22287  * @cname('__pyx_memoryview_err')
22288  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
22289  * if msg != NULL:
22290  * raise error(msg.decode('ascii'))
22291  */
22292  __Pyx_TraceLine(1263,0,__PYX_ERR(2, 1263, __pyx_L1_error))
22293 
22294 
22295  /* "View.MemoryView":1270
22296  *
22297  * @cname('__pyx_memoryview_copy_contents')
22298  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
22299  * __Pyx_memviewslice dst,
22300  * int src_ndim, int dst_ndim,
22301  */
22302  __Pyx_TraceLine(1270,0,__PYX_ERR(2, 1270, __pyx_L1_error))
22303 
22304 
22305  /* "View.MemoryView":1342
22306  *
22307  * @cname('__pyx_memoryview_broadcast_leading')
22308  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
22309  * int ndim,
22310  * int ndim_other) nogil:
22311  */
22312  __Pyx_TraceLine(1342,0,__PYX_ERR(2, 1342, __pyx_L1_error))
22313 
22314 
22315  /* "View.MemoryView":1364
22316  *
22317  * @cname('__pyx_memoryview_refcount_copying')
22318  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
22319  * int ndim, bint inc) nogil:
22320  *
22321  */
22322  __Pyx_TraceLine(1364,0,__PYX_ERR(2, 1364, __pyx_L1_error))
22323 
22324 
22325  /* "View.MemoryView":1373
22326  *
22327  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
22328  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
22329  * Py_ssize_t *strides, int ndim,
22330  * bint inc) with gil:
22331  */
22332  __Pyx_TraceLine(1373,0,__PYX_ERR(2, 1373, __pyx_L1_error))
22333 
22334 
22335  /* "View.MemoryView":1379
22336  *
22337  * @cname('__pyx_memoryview_refcount_objects_in_slice')
22338  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
22339  * Py_ssize_t *strides, int ndim, bint inc):
22340  * cdef Py_ssize_t i
22341  */
22342  __Pyx_TraceLine(1379,0,__PYX_ERR(2, 1379, __pyx_L1_error))
22343 
22344 
22345  /* "View.MemoryView":1399
22346  *
22347  * @cname('__pyx_memoryview_slice_assign_scalar')
22348  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
22349  * size_t itemsize, void *item,
22350  * bint dtype_is_object) nogil:
22351  */
22352  __Pyx_TraceLine(1399,0,__PYX_ERR(2, 1399, __pyx_L1_error))
22353 
22354 
22355  /* "View.MemoryView":1409
22356  *
22357  * @cname('__pyx_memoryview__slice_assign_scalar')
22358  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
22359  * Py_ssize_t *strides, int ndim,
22360  * size_t itemsize, void *item) nogil:
22361  */
22362  __Pyx_TraceLine(1409,0,__PYX_ERR(2, 1409, __pyx_L1_error))
22363 
22364 
22365  /* "(tree fragment)":1
22366  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
22367  * cdef object __pyx_PickleError
22368  * cdef object __pyx_result
22369  */
22370  __Pyx_TraceLine(1,0,__PYX_ERR(2, 1, __pyx_L1_error))
22371  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1, __pyx_L1_error)
22372  __Pyx_GOTREF(__pyx_t_1);
22373  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_1) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
22374  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22375 
22376  /* "(tree fragment)":11
22377  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
22378  * return __pyx_result
22379  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
22380  * __pyx_result.name = __pyx_state[0]
22381  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
22382  */
22383  __Pyx_TraceLine(11,0,__PYX_ERR(2, 11, __pyx_L1_error))
22384 
22385  __Pyx_TraceReturn(Py_None, 0);
22386 
22387  /*--- Wrapped vars code ---*/
22388 
22389  goto __pyx_L0;
22390  __pyx_L1_error:;
22391  __Pyx_XDECREF(__pyx_t_1);
22392  if (__pyx_m) {
22393  if (__pyx_d) {
22394  __Pyx_AddTraceback("init imate._c_trace_estimator.py_c_trace_estimator", __pyx_clineno, __pyx_lineno, __pyx_filename);
22395  }
22396  Py_CLEAR(__pyx_m);
22397  } else if (!PyErr_Occurred()) {
22398  PyErr_SetString(PyExc_ImportError, "init imate._c_trace_estimator.py_c_trace_estimator");
22399  }
22400  __pyx_L0:;
22401  __Pyx_RefNannyFinishContext();
22402  #if CYTHON_PEP489_MULTI_PHASE_INIT
22403  return (__pyx_m != NULL) ? 0 : -1;
22404  #elif PY_MAJOR_VERSION >= 3
22405  return __pyx_m;
22406  #else
22407  return;
22408  #endif
22409 }
22410 
22411 /* --- Runtime support code --- */
22412 /* Refnanny */
22413 #if CYTHON_REFNANNY
22414 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
22415  PyObject *m = NULL, *p = NULL;
22416  void *r = NULL;
22417  m = PyImport_ImportModule(modname);
22418  if (!m) goto end;
22419  p = PyObject_GetAttrString(m, "RefNannyAPI");
22420  if (!p) goto end;
22421  r = PyLong_AsVoidPtr(p);
22422 end:
22423  Py_XDECREF(p);
22424  Py_XDECREF(m);
22425  return (__Pyx_RefNannyAPIStruct *)r;
22426 }
22427 #endif
22428 
22429 /* PyObjectGetAttrStr */
22430 #if CYTHON_USE_TYPE_SLOTS
22431 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
22432  PyTypeObject* tp = Py_TYPE(obj);
22433  if (likely(tp->tp_getattro))
22434  return tp->tp_getattro(obj, attr_name);
22435 #if PY_MAJOR_VERSION < 3
22436  if (likely(tp->tp_getattr))
22437  return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
22438 #endif
22439  return PyObject_GetAttr(obj, attr_name);
22440 }
22441 #endif
22442 
22443 /* GetBuiltinName */
22444 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
22445  PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
22446  if (unlikely(!result)) {
22447  PyErr_Format(PyExc_NameError,
22448 #if PY_MAJOR_VERSION >= 3
22449  "name '%U' is not defined", name);
22450 #else
22451  "name '%.200s' is not defined", PyString_AS_STRING(name));
22452 #endif
22453  }
22454  return result;
22455 }
22456 
22457 /* PyErrFetchRestore */
22458 #if CYTHON_FAST_THREAD_STATE
22459 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
22460  PyObject *tmp_type, *tmp_value, *tmp_tb;
22461  tmp_type = tstate->curexc_type;
22462  tmp_value = tstate->curexc_value;
22463  tmp_tb = tstate->curexc_traceback;
22464  tstate->curexc_type = type;
22465  tstate->curexc_value = value;
22466  tstate->curexc_traceback = tb;
22467  Py_XDECREF(tmp_type);
22468  Py_XDECREF(tmp_value);
22469  Py_XDECREF(tmp_tb);
22470 }
22471 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
22472  *type = tstate->curexc_type;
22473  *value = tstate->curexc_value;
22474  *tb = tstate->curexc_traceback;
22475  tstate->curexc_type = 0;
22476  tstate->curexc_value = 0;
22477  tstate->curexc_traceback = 0;
22478 }
22479 #endif
22480 
22481 /* Profile */
22482 #if CYTHON_PROFILE
22483 static int __Pyx_TraceSetupAndCall(PyCodeObject** code,
22484  PyFrameObject** frame,
22485  PyThreadState* tstate,
22486  const char *funcname,
22487  const char *srcfile,
22488  int firstlineno) {
22489  PyObject *type, *value, *traceback;
22490  int retval;
22491  if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) {
22492  if (*code == NULL) {
22493  *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno);
22494  if (*code == NULL) return 0;
22495  }
22496  *frame = PyFrame_New(
22497  tstate, /*PyThreadState *tstate*/
22498  *code, /*PyCodeObject *code*/
22499  __pyx_d, /*PyObject *globals*/
22500  0 /*PyObject *locals*/
22501  );
22502  if (*frame == NULL) return 0;
22503  if (CYTHON_TRACE && (*frame)->f_trace == NULL) {
22504  Py_INCREF(Py_None);
22505  (*frame)->f_trace = Py_None;
22506  }
22507 #if PY_VERSION_HEX < 0x030400B1
22508  } else {
22509  (*frame)->f_tstate = tstate;
22510 #endif
22511  }
22512  __Pyx_PyFrame_SetLineNumber(*frame, firstlineno);
22513  retval = 1;
22514  __Pyx_EnterTracing(tstate);
22515  __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
22516  #if CYTHON_TRACE
22517  if (tstate->c_tracefunc)
22518  retval = tstate->c_tracefunc(tstate->c_traceobj, *frame, PyTrace_CALL, NULL) == 0;
22519  if (retval && tstate->c_profilefunc)
22520  #endif
22521  retval = tstate->c_profilefunc(tstate->c_profileobj, *frame, PyTrace_CALL, NULL) == 0;
22522  __Pyx_LeaveTracing(tstate);
22523  if (retval) {
22524  __Pyx_ErrRestoreInState(tstate, type, value, traceback);
22525  return __Pyx_IsTracing(tstate, 0, 0) && retval;
22526  } else {
22527  Py_XDECREF(type);
22528  Py_XDECREF(value);
22529  Py_XDECREF(traceback);
22530  return -1;
22531  }
22532 }
22533 static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno) {
22534  PyCodeObject *py_code = 0;
22535 #if PY_MAJOR_VERSION >= 3
22536  py_code = PyCode_NewEmpty(srcfile, funcname, firstlineno);
22537  if (likely(py_code)) {
22538  py_code->co_flags |= CO_OPTIMIZED | CO_NEWLOCALS;
22539  }
22540 #else
22541  PyObject *py_srcfile = 0;
22542  PyObject *py_funcname = 0;
22543  py_funcname = PyString_FromString(funcname);
22544  if (unlikely(!py_funcname)) goto bad;
22545  py_srcfile = PyString_FromString(srcfile);
22546  if (unlikely(!py_srcfile)) goto bad;
22547  py_code = PyCode_New(
22548  0,
22549  0,
22550  0,
22551  CO_OPTIMIZED | CO_NEWLOCALS,
22552  __pyx_empty_bytes, /*PyObject *code,*/
22553  __pyx_empty_tuple, /*PyObject *consts,*/
22554  __pyx_empty_tuple, /*PyObject *names,*/
22555  __pyx_empty_tuple, /*PyObject *varnames,*/
22556  __pyx_empty_tuple, /*PyObject *freevars,*/
22557  __pyx_empty_tuple, /*PyObject *cellvars,*/
22558  py_srcfile, /*PyObject *filename,*/
22559  py_funcname, /*PyObject *name,*/
22560  firstlineno,
22561  __pyx_empty_bytes /*PyObject *lnotab*/
22562  );
22563 bad:
22564  Py_XDECREF(py_srcfile);
22565  Py_XDECREF(py_funcname);
22566 #endif
22567  return py_code;
22568 }
22569 #endif
22570 
22571 /* WriteUnraisableException */
22572 static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
22573  CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
22574  int full_traceback, CYTHON_UNUSED int nogil) {
22575  PyObject *old_exc, *old_val, *old_tb;
22576  PyObject *ctx;
22577  __Pyx_PyThreadState_declare
22578 #ifdef WITH_THREAD
22579  PyGILState_STATE state;
22580  if (nogil)
22581  state = PyGILState_Ensure();
22582  else state = (PyGILState_STATE)0;
22583 #endif
22584  __Pyx_PyThreadState_assign
22585  __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
22586  if (full_traceback) {
22587  Py_XINCREF(old_exc);
22588  Py_XINCREF(old_val);
22589  Py_XINCREF(old_tb);
22590  __Pyx_ErrRestore(old_exc, old_val, old_tb);
22591  PyErr_PrintEx(1);
22592  }
22593  #if PY_MAJOR_VERSION < 3
22594  ctx = PyString_FromString(name);
22595  #else
22596  ctx = PyUnicode_FromString(name);
22597  #endif
22598  __Pyx_ErrRestore(old_exc, old_val, old_tb);
22599  if (!ctx) {
22600  PyErr_WriteUnraisable(Py_None);
22601  } else {
22602  PyErr_WriteUnraisable(ctx);
22603  Py_DECREF(ctx);
22604  }
22605 #ifdef WITH_THREAD
22606  if (nogil)
22607  PyGILState_Release(state);
22608 #endif
22609 }
22610 
22611 /* BytesEquals */
22612 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
22613 #if CYTHON_COMPILING_IN_PYPY
22614  return PyObject_RichCompareBool(s1, s2, equals);
22615 #else
22616  if (s1 == s2) {
22617  return (equals == Py_EQ);
22618  } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
22619  const char *ps1, *ps2;
22620  Py_ssize_t length = PyBytes_GET_SIZE(s1);
22621  if (length != PyBytes_GET_SIZE(s2))
22622  return (equals == Py_NE);
22623  ps1 = PyBytes_AS_STRING(s1);
22624  ps2 = PyBytes_AS_STRING(s2);
22625  if (ps1[0] != ps2[0]) {
22626  return (equals == Py_NE);
22627  } else if (length == 1) {
22628  return (equals == Py_EQ);
22629  } else {
22630  int result;
22631 #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000)
22632  Py_hash_t hash1, hash2;
22633  hash1 = ((PyBytesObject*)s1)->ob_shash;
22634  hash2 = ((PyBytesObject*)s2)->ob_shash;
22635  if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
22636  return (equals == Py_NE);
22637  }
22638 #endif
22639  result = memcmp(ps1, ps2, (size_t)length);
22640  return (equals == Py_EQ) ? (result == 0) : (result != 0);
22641  }
22642  } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
22643  return (equals == Py_NE);
22644  } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
22645  return (equals == Py_NE);
22646  } else {
22647  int result;
22648  PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
22649  if (!py_result)
22650  return -1;
22651  result = __Pyx_PyObject_IsTrue(py_result);
22652  Py_DECREF(py_result);
22653  return result;
22654  }
22655 #endif
22656 }
22657 
22658 /* MemviewSliceInit */
22659 static int
22660 __Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
22661  int ndim,
22662  __Pyx_memviewslice *memviewslice,
22663  int memview_is_new_reference)
22664 {
22665  __Pyx_RefNannyDeclarations
22666  int i, retval=-1;
22667  Py_buffer *buf = &memview->view;
22668  __Pyx_RefNannySetupContext("init_memviewslice", 0);
22669  if (unlikely(memviewslice->memview || memviewslice->data)) {
22670  PyErr_SetString(PyExc_ValueError,
22671  "memviewslice is already initialized!");
22672  goto fail;
22673  }
22674  if (buf->strides) {
22675  for (i = 0; i < ndim; i++) {
22676  memviewslice->strides[i] = buf->strides[i];
22677  }
22678  } else {
22679  Py_ssize_t stride = buf->itemsize;
22680  for (i = ndim - 1; i >= 0; i--) {
22681  memviewslice->strides[i] = stride;
22682  stride *= buf->shape[i];
22683  }
22684  }
22685  for (i = 0; i < ndim; i++) {
22686  memviewslice->shape[i] = buf->shape[i];
22687  if (buf->suboffsets) {
22688  memviewslice->suboffsets[i] = buf->suboffsets[i];
22689  } else {
22690  memviewslice->suboffsets[i] = -1;
22691  }
22692  }
22693  memviewslice->memview = memview;
22694  memviewslice->data = (char *)buf->buf;
22695  if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
22696  Py_INCREF(memview);
22697  }
22698  retval = 0;
22699  goto no_fail;
22700 fail:
22701  memviewslice->memview = 0;
22702  memviewslice->data = 0;
22703  retval = -1;
22704 no_fail:
22705  __Pyx_RefNannyFinishContext();
22706  return retval;
22707 }
22708 #ifndef Py_NO_RETURN
22709 #define Py_NO_RETURN
22710 #endif
22711 static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN {
22712  va_list vargs;
22713  char msg[200];
22714 #if PY_VERSION_HEX >= 0x030A0000 || defined(HAVE_STDARG_PROTOTYPES)
22715  va_start(vargs, fmt);
22716 #else
22717  va_start(vargs);
22718 #endif
22719  vsnprintf(msg, 200, fmt, vargs);
22720  va_end(vargs);
22721  Py_FatalError(msg);
22722 }
22723 static CYTHON_INLINE int
22724 __pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
22725  PyThread_type_lock lock)
22726 {
22727  int result;
22728  PyThread_acquire_lock(lock, 1);
22729  result = (*acquisition_count)++;
22730  PyThread_release_lock(lock);
22731  return result;
22732 }
22733 static CYTHON_INLINE int
22734 __pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
22735  PyThread_type_lock lock)
22736 {
22737  int result;
22738  PyThread_acquire_lock(lock, 1);
22739  result = (*acquisition_count)--;
22740  PyThread_release_lock(lock);
22741  return result;
22742 }
22743 static CYTHON_INLINE void
22744 __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
22745 {
22746  int first_time;
22747  struct __pyx_memoryview_obj *memview = memslice->memview;
22748  if (unlikely(!memview || (PyObject *) memview == Py_None))
22749  return;
22750  if (unlikely(__pyx_get_slice_count(memview) < 0))
22751  __pyx_fatalerror("Acquisition count is %d (line %d)",
22752  __pyx_get_slice_count(memview), lineno);
22753  first_time = __pyx_add_acquisition_count(memview) == 0;
22754  if (unlikely(first_time)) {
22755  if (have_gil) {
22756  Py_INCREF((PyObject *) memview);
22757  } else {
22758  PyGILState_STATE _gilstate = PyGILState_Ensure();
22759  Py_INCREF((PyObject *) memview);
22760  PyGILState_Release(_gilstate);
22761  }
22762  }
22763 }
22764 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
22765  int have_gil, int lineno) {
22766  int last_time;
22767  struct __pyx_memoryview_obj *memview = memslice->memview;
22768  if (unlikely(!memview || (PyObject *) memview == Py_None)) {
22769  memslice->memview = NULL;
22770  return;
22771  }
22772  if (unlikely(__pyx_get_slice_count(memview) <= 0))
22773  __pyx_fatalerror("Acquisition count is %d (line %d)",
22774  __pyx_get_slice_count(memview), lineno);
22775  last_time = __pyx_sub_acquisition_count(memview) == 1;
22776  memslice->data = NULL;
22777  if (unlikely(last_time)) {
22778  if (have_gil) {
22779  Py_CLEAR(memslice->memview);
22780  } else {
22781  PyGILState_STATE _gilstate = PyGILState_Ensure();
22782  Py_CLEAR(memslice->memview);
22783  PyGILState_Release(_gilstate);
22784  }
22785  } else {
22786  memslice->memview = NULL;
22787  }
22788 }
22789 
22790 /* PyObjectCall */
22791 #if CYTHON_COMPILING_IN_CPYTHON
22792 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
22793  PyObject *result;
22794  ternaryfunc call = Py_TYPE(func)->tp_call;
22795  if (unlikely(!call))
22796  return PyObject_Call(func, arg, kw);
22797  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
22798  return NULL;
22799  result = (*call)(func, arg, kw);
22800  Py_LeaveRecursiveCall();
22801  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
22802  PyErr_SetString(
22803  PyExc_SystemError,
22804  "NULL result without error in PyObject_Call");
22805  }
22806  return result;
22807 }
22808 #endif
22809 
22810 /* RaiseException */
22811 #if PY_MAJOR_VERSION < 3
22812 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
22813  CYTHON_UNUSED PyObject *cause) {
22814  __Pyx_PyThreadState_declare
22815  Py_XINCREF(type);
22816  if (!value || value == Py_None)
22817  value = NULL;
22818  else
22819  Py_INCREF(value);
22820  if (!tb || tb == Py_None)
22821  tb = NULL;
22822  else {
22823  Py_INCREF(tb);
22824  if (!PyTraceBack_Check(tb)) {
22825  PyErr_SetString(PyExc_TypeError,
22826  "raise: arg 3 must be a traceback or None");
22827  goto raise_error;
22828  }
22829  }
22830  if (PyType_Check(type)) {
22831 #if CYTHON_COMPILING_IN_PYPY
22832  if (!value) {
22833  Py_INCREF(Py_None);
22834  value = Py_None;
22835  }
22836 #endif
22837  PyErr_NormalizeException(&type, &value, &tb);
22838  } else {
22839  if (value) {
22840  PyErr_SetString(PyExc_TypeError,
22841  "instance exception may not have a separate value");
22842  goto raise_error;
22843  }
22844  value = type;
22845  type = (PyObject*) Py_TYPE(type);
22846  Py_INCREF(type);
22847  if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
22848  PyErr_SetString(PyExc_TypeError,
22849  "raise: exception class must be a subclass of BaseException");
22850  goto raise_error;
22851  }
22852  }
22853  __Pyx_PyThreadState_assign
22854  __Pyx_ErrRestore(type, value, tb);
22855  return;
22856 raise_error:
22857  Py_XDECREF(value);
22858  Py_XDECREF(type);
22859  Py_XDECREF(tb);
22860  return;
22861 }
22862 #else
22863 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
22864  PyObject* owned_instance = NULL;
22865  if (tb == Py_None) {
22866  tb = 0;
22867  } else if (tb && !PyTraceBack_Check(tb)) {
22868  PyErr_SetString(PyExc_TypeError,
22869  "raise: arg 3 must be a traceback or None");
22870  goto bad;
22871  }
22872  if (value == Py_None)
22873  value = 0;
22874  if (PyExceptionInstance_Check(type)) {
22875  if (value) {
22876  PyErr_SetString(PyExc_TypeError,
22877  "instance exception may not have a separate value");
22878  goto bad;
22879  }
22880  value = type;
22881  type = (PyObject*) Py_TYPE(value);
22882  } else if (PyExceptionClass_Check(type)) {
22883  PyObject *instance_class = NULL;
22884  if (value && PyExceptionInstance_Check(value)) {
22885  instance_class = (PyObject*) Py_TYPE(value);
22886  if (instance_class != type) {
22887  int is_subclass = PyObject_IsSubclass(instance_class, type);
22888  if (!is_subclass) {
22889  instance_class = NULL;
22890  } else if (unlikely(is_subclass == -1)) {
22891  goto bad;
22892  } else {
22893  type = instance_class;
22894  }
22895  }
22896  }
22897  if (!instance_class) {
22898  PyObject *args;
22899  if (!value)
22900  args = PyTuple_New(0);
22901  else if (PyTuple_Check(value)) {
22902  Py_INCREF(value);
22903  args = value;
22904  } else
22905  args = PyTuple_Pack(1, value);
22906  if (!args)
22907  goto bad;
22908  owned_instance = PyObject_Call(type, args, NULL);
22909  Py_DECREF(args);
22910  if (!owned_instance)
22911  goto bad;
22912  value = owned_instance;
22913  if (!PyExceptionInstance_Check(value)) {
22914  PyErr_Format(PyExc_TypeError,
22915  "calling %R should have returned an instance of "
22916  "BaseException, not %R",
22917  type, Py_TYPE(value));
22918  goto bad;
22919  }
22920  }
22921  } else {
22922  PyErr_SetString(PyExc_TypeError,
22923  "raise: exception class must be a subclass of BaseException");
22924  goto bad;
22925  }
22926  if (cause) {
22927  PyObject *fixed_cause;
22928  if (cause == Py_None) {
22929  fixed_cause = NULL;
22930  } else if (PyExceptionClass_Check(cause)) {
22931  fixed_cause = PyObject_CallObject(cause, NULL);
22932  if (fixed_cause == NULL)
22933  goto bad;
22934  } else if (PyExceptionInstance_Check(cause)) {
22935  fixed_cause = cause;
22936  Py_INCREF(fixed_cause);
22937  } else {
22938  PyErr_SetString(PyExc_TypeError,
22939  "exception causes must derive from "
22940  "BaseException");
22941  goto bad;
22942  }
22943  PyException_SetCause(value, fixed_cause);
22944  }
22945  PyErr_SetObject(type, value);
22946  if (tb) {
22947 #if CYTHON_FAST_THREAD_STATE
22948  PyThreadState *tstate = __Pyx_PyThreadState_Current;
22949  PyObject* tmp_tb = tstate->curexc_traceback;
22950  if (tb != tmp_tb) {
22951  Py_INCREF(tb);
22952  tstate->curexc_traceback = tb;
22953  Py_XDECREF(tmp_tb);
22954  }
22955 #else
22956  PyObject *tmp_type, *tmp_value, *tmp_tb;
22957  PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
22958  Py_INCREF(tb);
22959  PyErr_Restore(tmp_type, tmp_value, tb);
22960  Py_XDECREF(tmp_tb);
22961 #endif
22962  }
22963 bad:
22964  Py_XDECREF(owned_instance);
22965  return;
22966 }
22967 #endif
22968 
22969 /* SetItemInt */
22970 static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
22971  int r;
22972  if (!j) return -1;
22973  r = PyObject_SetItem(o, j, v);
22974  Py_DECREF(j);
22975  return r;
22976 }
22977 static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list,
22978  CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) {
22979 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
22980  if (is_list || PyList_CheckExact(o)) {
22981  Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o));
22982  if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o)))) {
22983  PyObject* old = PyList_GET_ITEM(o, n);
22984  Py_INCREF(v);
22985  PyList_SET_ITEM(o, n, v);
22986  Py_DECREF(old);
22987  return 1;
22988  }
22989  } else {
22990  PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
22991  if (likely(m && m->sq_ass_item)) {
22992  if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
22993  Py_ssize_t l = m->sq_length(o);
22994  if (likely(l >= 0)) {
22995  i += l;
22996  } else {
22997  if (!PyErr_ExceptionMatches(PyExc_OverflowError))
22998  return -1;
22999  PyErr_Clear();
23000  }
23001  }
23002  return m->sq_ass_item(o, i, v);
23003  }
23004  }
23005 #else
23006 #if CYTHON_COMPILING_IN_PYPY
23007  if (is_list || (PySequence_Check(o) && !PyDict_Check(o)))
23008 #else
23009  if (is_list || PySequence_Check(o))
23010 #endif
23011  {
23012  return PySequence_SetItem(o, i, v);
23013  }
23014 #endif
23015  return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v);
23016 }
23017 
23018 /* RaiseArgTupleInvalid */
23019 static void __Pyx_RaiseArgtupleInvalid(
23020  const char* func_name,
23021  int exact,
23022  Py_ssize_t num_min,
23023  Py_ssize_t num_max,
23024  Py_ssize_t num_found)
23025 {
23026  Py_ssize_t num_expected;
23027  const char *more_or_less;
23028  if (num_found < num_min) {
23029  num_expected = num_min;
23030  more_or_less = "at least";
23031  } else {
23032  num_expected = num_max;
23033  more_or_less = "at most";
23034  }
23035  if (exact) {
23036  more_or_less = "exactly";
23037  }
23038  PyErr_Format(PyExc_TypeError,
23039  "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
23040  func_name, more_or_less, num_expected,
23041  (num_expected == 1) ? "" : "s", num_found);
23042 }
23043 
23044 /* RaiseDoubleKeywords */
23045 static void __Pyx_RaiseDoubleKeywordsError(
23046  const char* func_name,
23047  PyObject* kw_name)
23048 {
23049  PyErr_Format(PyExc_TypeError,
23050  #if PY_MAJOR_VERSION >= 3
23051  "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
23052  #else
23053  "%s() got multiple values for keyword argument '%s'", func_name,
23054  PyString_AsString(kw_name));
23055  #endif
23056 }
23057 
23058 /* ParseKeywords */
23059 static int __Pyx_ParseOptionalKeywords(
23060  PyObject *kwds,
23061  PyObject **argnames[],
23062  PyObject *kwds2,
23063  PyObject *values[],
23064  Py_ssize_t num_pos_args,
23065  const char* function_name)
23066 {
23067  PyObject *key = 0, *value = 0;
23068  Py_ssize_t pos = 0;
23069  PyObject*** name;
23070  PyObject*** first_kw_arg = argnames + num_pos_args;
23071  while (PyDict_Next(kwds, &pos, &key, &value)) {
23072  name = first_kw_arg;
23073  while (*name && (**name != key)) name++;
23074  if (*name) {
23075  values[name-argnames] = value;
23076  continue;
23077  }
23078  name = first_kw_arg;
23079  #if PY_MAJOR_VERSION < 3
23080  if (likely(PyString_Check(key))) {
23081  while (*name) {
23082  if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
23083  && _PyString_Eq(**name, key)) {
23084  values[name-argnames] = value;
23085  break;
23086  }
23087  name++;
23088  }
23089  if (*name) continue;
23090  else {
23091  PyObject*** argname = argnames;
23092  while (argname != first_kw_arg) {
23093  if ((**argname == key) || (
23094  (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
23095  && _PyString_Eq(**argname, key))) {
23096  goto arg_passed_twice;
23097  }
23098  argname++;
23099  }
23100  }
23101  } else
23102  #endif
23103  if (likely(PyUnicode_Check(key))) {
23104  while (*name) {
23105  int cmp = (**name == key) ? 0 :
23106  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
23107  (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
23108  #endif
23109  PyUnicode_Compare(**name, key);
23110  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
23111  if (cmp == 0) {
23112  values[name-argnames] = value;
23113  break;
23114  }
23115  name++;
23116  }
23117  if (*name) continue;
23118  else {
23119  PyObject*** argname = argnames;
23120  while (argname != first_kw_arg) {
23121  int cmp = (**argname == key) ? 0 :
23122  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
23123  (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
23124  #endif
23125  PyUnicode_Compare(**argname, key);
23126  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
23127  if (cmp == 0) goto arg_passed_twice;
23128  argname++;
23129  }
23130  }
23131  } else
23132  goto invalid_keyword_type;
23133  if (kwds2) {
23134  if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
23135  } else {
23136  goto invalid_keyword;
23137  }
23138  }
23139  return 0;
23140 arg_passed_twice:
23141  __Pyx_RaiseDoubleKeywordsError(function_name, key);
23142  goto bad;
23143 invalid_keyword_type:
23144  PyErr_Format(PyExc_TypeError,
23145  "%.200s() keywords must be strings", function_name);
23146  goto bad;
23147 invalid_keyword:
23148  PyErr_Format(PyExc_TypeError,
23149  #if PY_MAJOR_VERSION < 3
23150  "%.200s() got an unexpected keyword argument '%.200s'",
23151  function_name, PyString_AsString(key));
23152  #else
23153  "%s() got an unexpected keyword argument '%U'",
23154  function_name, key);
23155  #endif
23156 bad:
23157  return -1;
23158 }
23159 
23160 /* ArgTypeTest */
23161 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
23162 {
23163  if (unlikely(!type)) {
23164  PyErr_SetString(PyExc_SystemError, "Missing type object");
23165  return 0;
23166  }
23167  else if (exact) {
23168  #if PY_MAJOR_VERSION == 2
23169  if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
23170  #endif
23171  }
23172  else {
23173  if (likely(__Pyx_TypeCheck(obj, type))) return 1;
23174  }
23175  PyErr_Format(PyExc_TypeError,
23176  "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
23177  name, type->tp_name, Py_TYPE(obj)->tp_name);
23178  return 0;
23179 }
23180 
23181 /* PyDictVersioning */
23182 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
23183 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
23184  PyObject *dict = Py_TYPE(obj)->tp_dict;
23185  return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
23186 }
23187 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
23188  PyObject **dictptr = NULL;
23189  Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
23190  if (offset) {
23191 #if CYTHON_COMPILING_IN_CPYTHON
23192  dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
23193 #else
23194  dictptr = _PyObject_GetDictPtr(obj);
23195 #endif
23196  }
23197  return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
23198 }
23199 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
23200  PyObject *dict = Py_TYPE(obj)->tp_dict;
23201  if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
23202  return 0;
23203  return obj_dict_version == __Pyx_get_object_dict_version(obj);
23204 }
23205 #endif
23206 
23207 /* GetModuleGlobalName */
23208 #if CYTHON_USE_DICT_VERSIONS
23209 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
23210 #else
23211 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
23212 #endif
23213 {
23214  PyObject *result;
23215 #if !CYTHON_AVOID_BORROWED_REFS
23216 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
23217  result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
23218  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
23219  if (likely(result)) {
23220  return __Pyx_NewRef(result);
23221  } else if (unlikely(PyErr_Occurred())) {
23222  return NULL;
23223  }
23224 #else
23225  result = PyDict_GetItem(__pyx_d, name);
23226  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
23227  if (likely(result)) {
23228  return __Pyx_NewRef(result);
23229  }
23230 #endif
23231 #else
23232  result = PyObject_GetItem(__pyx_d, name);
23233  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
23234  if (likely(result)) {
23235  return __Pyx_NewRef(result);
23236  }
23237  PyErr_Clear();
23238 #endif
23239  return __Pyx_GetBuiltinName(name);
23240 }
23241 
23242 /* PyCFunctionFastCall */
23243 #if CYTHON_FAST_PYCCALL
23244 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
23245  PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
23246  PyCFunction meth = PyCFunction_GET_FUNCTION(func);
23247  PyObject *self = PyCFunction_GET_SELF(func);
23248  int flags = PyCFunction_GET_FLAGS(func);
23249  assert(PyCFunction_Check(func));
23250  assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
23251  assert(nargs >= 0);
23252  assert(nargs == 0 || args != NULL);
23253  /* _PyCFunction_FastCallDict() must not be called with an exception set,
23254  because it may clear it (directly or indirectly) and so the
23255  caller loses its exception */
23256  assert(!PyErr_Occurred());
23257  if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
23258  return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
23259  } else {
23260  return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
23261  }
23262 }
23263 #endif
23264 
23265 /* PyFunctionFastCall */
23266 #if CYTHON_FAST_PYCALL
23267 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
23268  PyObject *globals) {
23269  PyFrameObject *f;
23270  PyThreadState *tstate = __Pyx_PyThreadState_Current;
23271  PyObject **fastlocals;
23272  Py_ssize_t i;
23273  PyObject *result;
23274  assert(globals != NULL);
23275  /* XXX Perhaps we should create a specialized
23276  PyFrame_New() that doesn't take locals, but does
23277  take builtins without sanity checking them.
23278  */
23279  assert(tstate != NULL);
23280  f = PyFrame_New(tstate, co, globals, NULL);
23281  if (f == NULL) {
23282  return NULL;
23283  }
23284  fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
23285  for (i = 0; i < na; i++) {
23286  Py_INCREF(*args);
23287  fastlocals[i] = *args++;
23288  }
23289  result = PyEval_EvalFrameEx(f,0);
23290  ++tstate->recursion_depth;
23291  Py_DECREF(f);
23292  --tstate->recursion_depth;
23293  return result;
23294 }
23295 #if 1 || PY_VERSION_HEX < 0x030600B1
23296 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
23297  PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
23298  PyObject *globals = PyFunction_GET_GLOBALS(func);
23299  PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
23300  PyObject *closure;
23301 #if PY_MAJOR_VERSION >= 3
23302  PyObject *kwdefs;
23303 #endif
23304  PyObject *kwtuple, **k;
23305  PyObject **d;
23306  Py_ssize_t nd;
23307  Py_ssize_t nk;
23308  PyObject *result;
23309  assert(kwargs == NULL || PyDict_Check(kwargs));
23310  nk = kwargs ? PyDict_Size(kwargs) : 0;
23311  if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
23312  return NULL;
23313  }
23314  if (
23315 #if PY_MAJOR_VERSION >= 3
23316  co->co_kwonlyargcount == 0 &&
23317 #endif
23318  likely(kwargs == NULL || nk == 0) &&
23319  co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
23320  if (argdefs == NULL && co->co_argcount == nargs) {
23321  result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
23322  goto done;
23323  }
23324  else if (nargs == 0 && argdefs != NULL
23325  && co->co_argcount == Py_SIZE(argdefs)) {
23326  /* function called with no arguments, but all parameters have
23327  a default value: use default values as arguments .*/
23328  args = &PyTuple_GET_ITEM(argdefs, 0);
23329  result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
23330  goto done;
23331  }
23332  }
23333  if (kwargs != NULL) {
23334  Py_ssize_t pos, i;
23335  kwtuple = PyTuple_New(2 * nk);
23336  if (kwtuple == NULL) {
23337  result = NULL;
23338  goto done;
23339  }
23340  k = &PyTuple_GET_ITEM(kwtuple, 0);
23341  pos = i = 0;
23342  while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
23343  Py_INCREF(k[i]);
23344  Py_INCREF(k[i+1]);
23345  i += 2;
23346  }
23347  nk = i / 2;
23348  }
23349  else {
23350  kwtuple = NULL;
23351  k = NULL;
23352  }
23353  closure = PyFunction_GET_CLOSURE(func);
23354 #if PY_MAJOR_VERSION >= 3
23355  kwdefs = PyFunction_GET_KW_DEFAULTS(func);
23356 #endif
23357  if (argdefs != NULL) {
23358  d = &PyTuple_GET_ITEM(argdefs, 0);
23359  nd = Py_SIZE(argdefs);
23360  }
23361  else {
23362  d = NULL;
23363  nd = 0;
23364  }
23365 #if PY_MAJOR_VERSION >= 3
23366  result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
23367  args, (int)nargs,
23368  k, (int)nk,
23369  d, (int)nd, kwdefs, closure);
23370 #else
23371  result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
23372  args, (int)nargs,
23373  k, (int)nk,
23374  d, (int)nd, closure);
23375 #endif
23376  Py_XDECREF(kwtuple);
23377 done:
23378  Py_LeaveRecursiveCall();
23379  return result;
23380 }
23381 #endif
23382 #endif
23383 
23384 /* PyObjectCall2Args */
23385 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
23386  PyObject *args, *result = NULL;
23387  #if CYTHON_FAST_PYCALL
23388  if (PyFunction_Check(function)) {
23389  PyObject *args[2] = {arg1, arg2};
23390  return __Pyx_PyFunction_FastCall(function, args, 2);
23391  }
23392  #endif
23393  #if CYTHON_FAST_PYCCALL
23394  if (__Pyx_PyFastCFunction_Check(function)) {
23395  PyObject *args[2] = {arg1, arg2};
23396  return __Pyx_PyCFunction_FastCall(function, args, 2);
23397  }
23398  #endif
23399  args = PyTuple_New(2);
23400  if (unlikely(!args)) goto done;
23401  Py_INCREF(arg1);
23402  PyTuple_SET_ITEM(args, 0, arg1);
23403  Py_INCREF(arg2);
23404  PyTuple_SET_ITEM(args, 1, arg2);
23405  Py_INCREF(function);
23406  result = __Pyx_PyObject_Call(function, args, NULL);
23407  Py_DECREF(args);
23408  Py_DECREF(function);
23409 done:
23410  return result;
23411 }
23412 
23413 /* PyObjectCallMethO */
23414 #if CYTHON_COMPILING_IN_CPYTHON
23415 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
23416  PyObject *self, *result;
23417  PyCFunction cfunc;
23418  cfunc = PyCFunction_GET_FUNCTION(func);
23419  self = PyCFunction_GET_SELF(func);
23420  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
23421  return NULL;
23422  result = cfunc(self, arg);
23423  Py_LeaveRecursiveCall();
23424  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
23425  PyErr_SetString(
23426  PyExc_SystemError,
23427  "NULL result without error in PyObject_Call");
23428  }
23429  return result;
23430 }
23431 #endif
23432 
23433 /* PyObjectCallOneArg */
23434 #if CYTHON_COMPILING_IN_CPYTHON
23435 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
23436  PyObject *result;
23437  PyObject *args = PyTuple_New(1);
23438  if (unlikely(!args)) return NULL;
23439  Py_INCREF(arg);
23440  PyTuple_SET_ITEM(args, 0, arg);
23441  result = __Pyx_PyObject_Call(func, args, NULL);
23442  Py_DECREF(args);
23443  return result;
23444 }
23445 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
23446 #if CYTHON_FAST_PYCALL
23447  if (PyFunction_Check(func)) {
23448  return __Pyx_PyFunction_FastCall(func, &arg, 1);
23449  }
23450 #endif
23451  if (likely(PyCFunction_Check(func))) {
23452  if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
23453  return __Pyx_PyObject_CallMethO(func, arg);
23454 #if CYTHON_FAST_PYCCALL
23455  } else if (__Pyx_PyFastCFunction_Check(func)) {
23456  return __Pyx_PyCFunction_FastCall(func, &arg, 1);
23457 #endif
23458  }
23459  }
23460  return __Pyx__PyObject_CallOneArg(func, arg);
23461 }
23462 #else
23463 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
23464  PyObject *result;
23465  PyObject *args = PyTuple_Pack(1, arg);
23466  if (unlikely(!args)) return NULL;
23467  result = __Pyx_PyObject_Call(func, args, NULL);
23468  Py_DECREF(args);
23469  return result;
23470 }
23471 #endif
23472 
23473 /* UnicodeEquals */
23474 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
23475 #if CYTHON_COMPILING_IN_PYPY
23476  return PyObject_RichCompareBool(s1, s2, equals);
23477 #else
23478 #if PY_MAJOR_VERSION < 3
23479  PyObject* owned_ref = NULL;
23480 #endif
23481  int s1_is_unicode, s2_is_unicode;
23482  if (s1 == s2) {
23483  goto return_eq;
23484  }
23485  s1_is_unicode = PyUnicode_CheckExact(s1);
23486  s2_is_unicode = PyUnicode_CheckExact(s2);
23487 #if PY_MAJOR_VERSION < 3
23488  if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
23489  owned_ref = PyUnicode_FromObject(s2);
23490  if (unlikely(!owned_ref))
23491  return -1;
23492  s2 = owned_ref;
23493  s2_is_unicode = 1;
23494  } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
23495  owned_ref = PyUnicode_FromObject(s1);
23496  if (unlikely(!owned_ref))
23497  return -1;
23498  s1 = owned_ref;
23499  s1_is_unicode = 1;
23500  } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
23501  return __Pyx_PyBytes_Equals(s1, s2, equals);
23502  }
23503 #endif
23504  if (s1_is_unicode & s2_is_unicode) {
23505  Py_ssize_t length;
23506  int kind;
23507  void *data1, *data2;
23508  if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
23509  return -1;
23510  length = __Pyx_PyUnicode_GET_LENGTH(s1);
23511  if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
23512  goto return_ne;
23513  }
23514 #if CYTHON_USE_UNICODE_INTERNALS
23515  {
23516  Py_hash_t hash1, hash2;
23517  #if CYTHON_PEP393_ENABLED
23518  hash1 = ((PyASCIIObject*)s1)->hash;
23519  hash2 = ((PyASCIIObject*)s2)->hash;
23520  #else
23521  hash1 = ((PyUnicodeObject*)s1)->hash;
23522  hash2 = ((PyUnicodeObject*)s2)->hash;
23523  #endif
23524  if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
23525  goto return_ne;
23526  }
23527  }
23528 #endif
23529  kind = __Pyx_PyUnicode_KIND(s1);
23530  if (kind != __Pyx_PyUnicode_KIND(s2)) {
23531  goto return_ne;
23532  }
23533  data1 = __Pyx_PyUnicode_DATA(s1);
23534  data2 = __Pyx_PyUnicode_DATA(s2);
23535  if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
23536  goto return_ne;
23537  } else if (length == 1) {
23538  goto return_eq;
23539  } else {
23540  int result = memcmp(data1, data2, (size_t)(length * kind));
23541  #if PY_MAJOR_VERSION < 3
23542  Py_XDECREF(owned_ref);
23543  #endif
23544  return (equals == Py_EQ) ? (result == 0) : (result != 0);
23545  }
23546  } else if ((s1 == Py_None) & s2_is_unicode) {
23547  goto return_ne;
23548  } else if ((s2 == Py_None) & s1_is_unicode) {
23549  goto return_ne;
23550  } else {
23551  int result;
23552  PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
23553  #if PY_MAJOR_VERSION < 3
23554  Py_XDECREF(owned_ref);
23555  #endif
23556  if (!py_result)
23557  return -1;
23558  result = __Pyx_PyObject_IsTrue(py_result);
23559  Py_DECREF(py_result);
23560  return result;
23561  }
23562 return_eq:
23563  #if PY_MAJOR_VERSION < 3
23564  Py_XDECREF(owned_ref);
23565  #endif
23566  return (equals == Py_EQ);
23567 return_ne:
23568  #if PY_MAJOR_VERSION < 3
23569  Py_XDECREF(owned_ref);
23570  #endif
23571  return (equals == Py_NE);
23572 #endif
23573 }
23574 
23575 /* GetAttr */
23576 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
23577 #if CYTHON_USE_TYPE_SLOTS
23578 #if PY_MAJOR_VERSION >= 3
23579  if (likely(PyUnicode_Check(n)))
23580 #else
23581  if (likely(PyString_Check(n)))
23582 #endif
23583  return __Pyx_PyObject_GetAttrStr(o, n);
23584 #endif
23585  return PyObject_GetAttr(o, n);
23586 }
23587 
23588 /* GetItemInt */
23589 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
23590  PyObject *r;
23591  if (!j) return NULL;
23592  r = PyObject_GetItem(o, j);
23593  Py_DECREF(j);
23594  return r;
23595 }
23596 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
23597  CYTHON_NCP_UNUSED int wraparound,
23598  CYTHON_NCP_UNUSED int boundscheck) {
23599 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
23600  Py_ssize_t wrapped_i = i;
23601  if (wraparound & unlikely(i < 0)) {
23602  wrapped_i += PyList_GET_SIZE(o);
23603  }
23604  if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
23605  PyObject *r = PyList_GET_ITEM(o, wrapped_i);
23606  Py_INCREF(r);
23607  return r;
23608  }
23609  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
23610 #else
23611  return PySequence_GetItem(o, i);
23612 #endif
23613 }
23614 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
23615  CYTHON_NCP_UNUSED int wraparound,
23616  CYTHON_NCP_UNUSED int boundscheck) {
23617 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
23618  Py_ssize_t wrapped_i = i;
23619  if (wraparound & unlikely(i < 0)) {
23620  wrapped_i += PyTuple_GET_SIZE(o);
23621  }
23622  if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
23623  PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
23624  Py_INCREF(r);
23625  return r;
23626  }
23627  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
23628 #else
23629  return PySequence_GetItem(o, i);
23630 #endif
23631 }
23632 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
23633  CYTHON_NCP_UNUSED int wraparound,
23634  CYTHON_NCP_UNUSED int boundscheck) {
23635 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
23636  if (is_list || PyList_CheckExact(o)) {
23637  Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
23638  if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
23639  PyObject *r = PyList_GET_ITEM(o, n);
23640  Py_INCREF(r);
23641  return r;
23642  }
23643  }
23644  else if (PyTuple_CheckExact(o)) {
23645  Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
23646  if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
23647  PyObject *r = PyTuple_GET_ITEM(o, n);
23648  Py_INCREF(r);
23649  return r;
23650  }
23651  } else {
23652  PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
23653  if (likely(m && m->sq_item)) {
23654  if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
23655  Py_ssize_t l = m->sq_length(o);
23656  if (likely(l >= 0)) {
23657  i += l;
23658  } else {
23659  if (!PyErr_ExceptionMatches(PyExc_OverflowError))
23660  return NULL;
23661  PyErr_Clear();
23662  }
23663  }
23664  return m->sq_item(o, i);
23665  }
23666  }
23667 #else
23668  if (is_list || PySequence_Check(o)) {
23669  return PySequence_GetItem(o, i);
23670  }
23671 #endif
23672  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
23673 }
23674 
23675 /* ObjectGetItem */
23676 #if CYTHON_USE_TYPE_SLOTS
23677 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
23678  PyObject *runerr = NULL;
23679  Py_ssize_t key_value;
23680  PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
23681  if (unlikely(!(m && m->sq_item))) {
23682  PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
23683  return NULL;
23684  }
23685  key_value = __Pyx_PyIndex_AsSsize_t(index);
23686  if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
23687  return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
23688  }
23689  if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
23690  PyErr_Clear();
23691  PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
23692  }
23693  return NULL;
23694 }
23695 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
23696  PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
23697  if (likely(m && m->mp_subscript)) {
23698  return m->mp_subscript(obj, key);
23699  }
23700  return __Pyx_PyObject_GetIndex(obj, key);
23701 }
23702 #endif
23703 
23704 /* decode_c_string */
23705 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
23706  const char* cstring, Py_ssize_t start, Py_ssize_t stop,
23707  const char* encoding, const char* errors,
23708  PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
23709  Py_ssize_t length;
23710  if (unlikely((start < 0) | (stop < 0))) {
23711  size_t slen = strlen(cstring);
23712  if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) {
23713  PyErr_SetString(PyExc_OverflowError,
23714  "c-string too long to convert to Python");
23715  return NULL;
23716  }
23717  length = (Py_ssize_t) slen;
23718  if (start < 0) {
23719  start += length;
23720  if (start < 0)
23721  start = 0;
23722  }
23723  if (stop < 0)
23724  stop += length;
23725  }
23726  if (unlikely(stop <= start))
23727  return __Pyx_NewRef(__pyx_empty_unicode);
23728  length = stop - start;
23729  cstring += start;
23730  if (decode_func) {
23731  return decode_func(cstring, length, errors);
23732  } else {
23733  return PyUnicode_Decode(cstring, length, encoding, errors);
23734  }
23735 }
23736 
23737 /* PyErrExceptionMatches */
23738 #if CYTHON_FAST_THREAD_STATE
23739 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
23740  Py_ssize_t i, n;
23741  n = PyTuple_GET_SIZE(tuple);
23742 #if PY_MAJOR_VERSION >= 3
23743  for (i=0; i<n; i++) {
23744  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
23745  }
23746 #endif
23747  for (i=0; i<n; i++) {
23748  if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
23749  }
23750  return 0;
23751 }
23752 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
23753  PyObject *exc_type = tstate->curexc_type;
23754  if (exc_type == err) return 1;
23755  if (unlikely(!exc_type)) return 0;
23756  if (unlikely(PyTuple_Check(err)))
23757  return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
23758  return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
23759 }
23760 #endif
23761 
23762 /* GetAttr3 */
23763 static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
23764  __Pyx_PyThreadState_declare
23765  __Pyx_PyThreadState_assign
23766  if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
23767  return NULL;
23768  __Pyx_PyErr_Clear();
23769  Py_INCREF(d);
23770  return d;
23771 }
23772 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
23773  PyObject *r = __Pyx_GetAttr(o, n);
23774  return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
23775 }
23776 
23777 /* RaiseTooManyValuesToUnpack */
23778 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
23779  PyErr_Format(PyExc_ValueError,
23780  "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
23781 }
23782 
23783 /* RaiseNeedMoreValuesToUnpack */
23784 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
23785  PyErr_Format(PyExc_ValueError,
23786  "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
23787  index, (index == 1) ? "" : "s");
23788 }
23789 
23790 /* RaiseNoneIterError */
23791 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
23792  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
23793 }
23794 
23795 /* ExtTypeTest */
23796 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
23797  if (unlikely(!type)) {
23798  PyErr_SetString(PyExc_SystemError, "Missing type object");
23799  return 0;
23800  }
23801  if (likely(__Pyx_TypeCheck(obj, type)))
23802  return 1;
23803  PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
23804  Py_TYPE(obj)->tp_name, type->tp_name);
23805  return 0;
23806 }
23807 
23808 /* GetTopmostException */
23809 #if CYTHON_USE_EXC_INFO_STACK
23810 static _PyErr_StackItem *
23811 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
23812 {
23813  _PyErr_StackItem *exc_info = tstate->exc_info;
23814  while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
23815  exc_info->previous_item != NULL)
23816  {
23817  exc_info = exc_info->previous_item;
23818  }
23819  return exc_info;
23820 }
23821 #endif
23822 
23823 /* SaveResetException */
23824 #if CYTHON_FAST_THREAD_STATE
23825 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
23826  #if CYTHON_USE_EXC_INFO_STACK
23827  _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
23828  *type = exc_info->exc_type;
23829  *value = exc_info->exc_value;
23830  *tb = exc_info->exc_traceback;
23831  #else
23832  *type = tstate->exc_type;
23833  *value = tstate->exc_value;
23834  *tb = tstate->exc_traceback;
23835  #endif
23836  Py_XINCREF(*type);
23837  Py_XINCREF(*value);
23838  Py_XINCREF(*tb);
23839 }
23840 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
23841  PyObject *tmp_type, *tmp_value, *tmp_tb;
23842  #if CYTHON_USE_EXC_INFO_STACK
23843  _PyErr_StackItem *exc_info = tstate->exc_info;
23844  tmp_type = exc_info->exc_type;
23845  tmp_value = exc_info->exc_value;
23846  tmp_tb = exc_info->exc_traceback;
23847  exc_info->exc_type = type;
23848  exc_info->exc_value = value;
23849  exc_info->exc_traceback = tb;
23850  #else
23851  tmp_type = tstate->exc_type;
23852  tmp_value = tstate->exc_value;
23853  tmp_tb = tstate->exc_traceback;
23854  tstate->exc_type = type;
23855  tstate->exc_value = value;
23856  tstate->exc_traceback = tb;
23857  #endif
23858  Py_XDECREF(tmp_type);
23859  Py_XDECREF(tmp_value);
23860  Py_XDECREF(tmp_tb);
23861 }
23862 #endif
23863 
23864 /* GetException */
23865 #if CYTHON_FAST_THREAD_STATE
23866 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
23867 #else
23868 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
23869 #endif
23870 {
23871  PyObject *local_type, *local_value, *local_tb;
23872 #if CYTHON_FAST_THREAD_STATE
23873  PyObject *tmp_type, *tmp_value, *tmp_tb;
23874  local_type = tstate->curexc_type;
23875  local_value = tstate->curexc_value;
23876  local_tb = tstate->curexc_traceback;
23877  tstate->curexc_type = 0;
23878  tstate->curexc_value = 0;
23879  tstate->curexc_traceback = 0;
23880 #else
23881  PyErr_Fetch(&local_type, &local_value, &local_tb);
23882 #endif
23883  PyErr_NormalizeException(&local_type, &local_value, &local_tb);
23884 #if CYTHON_FAST_THREAD_STATE
23885  if (unlikely(tstate->curexc_type))
23886 #else
23887  if (unlikely(PyErr_Occurred()))
23888 #endif
23889  goto bad;
23890  #if PY_MAJOR_VERSION >= 3
23891  if (local_tb) {
23892  if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
23893  goto bad;
23894  }
23895  #endif
23896  Py_XINCREF(local_tb);
23897  Py_XINCREF(local_type);
23898  Py_XINCREF(local_value);
23899  *type = local_type;
23900  *value = local_value;
23901  *tb = local_tb;
23902 #if CYTHON_FAST_THREAD_STATE
23903  #if CYTHON_USE_EXC_INFO_STACK
23904  {
23905  _PyErr_StackItem *exc_info = tstate->exc_info;
23906  tmp_type = exc_info->exc_type;
23907  tmp_value = exc_info->exc_value;
23908  tmp_tb = exc_info->exc_traceback;
23909  exc_info->exc_type = local_type;
23910  exc_info->exc_value = local_value;
23911  exc_info->exc_traceback = local_tb;
23912  }
23913  #else
23914  tmp_type = tstate->exc_type;
23915  tmp_value = tstate->exc_value;
23916  tmp_tb = tstate->exc_traceback;
23917  tstate->exc_type = local_type;
23918  tstate->exc_value = local_value;
23919  tstate->exc_traceback = local_tb;
23920  #endif
23921  Py_XDECREF(tmp_type);
23922  Py_XDECREF(tmp_value);
23923  Py_XDECREF(tmp_tb);
23924 #else
23925  PyErr_SetExcInfo(local_type, local_value, local_tb);
23926 #endif
23927  return 0;
23928 bad:
23929  *type = 0;
23930  *value = 0;
23931  *tb = 0;
23932  Py_XDECREF(local_type);
23933  Py_XDECREF(local_value);
23934  Py_XDECREF(local_tb);
23935  return -1;
23936 }
23937 
23938 /* SwapException */
23939 #if CYTHON_FAST_THREAD_STATE
23940 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
23941  PyObject *tmp_type, *tmp_value, *tmp_tb;
23942  #if CYTHON_USE_EXC_INFO_STACK
23943  _PyErr_StackItem *exc_info = tstate->exc_info;
23944  tmp_type = exc_info->exc_type;
23945  tmp_value = exc_info->exc_value;
23946  tmp_tb = exc_info->exc_traceback;
23947  exc_info->exc_type = *type;
23948  exc_info->exc_value = *value;
23949  exc_info->exc_traceback = *tb;
23950  #else
23951  tmp_type = tstate->exc_type;
23952  tmp_value = tstate->exc_value;
23953  tmp_tb = tstate->exc_traceback;
23954  tstate->exc_type = *type;
23955  tstate->exc_value = *value;
23956  tstate->exc_traceback = *tb;
23957  #endif
23958  *type = tmp_type;
23959  *value = tmp_value;
23960  *tb = tmp_tb;
23961 }
23962 #else
23963 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
23964  PyObject *tmp_type, *tmp_value, *tmp_tb;
23965  PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
23966  PyErr_SetExcInfo(*type, *value, *tb);
23967  *type = tmp_type;
23968  *value = tmp_value;
23969  *tb = tmp_tb;
23970 }
23971 #endif
23972 
23973 /* Import */
23974 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
23975  PyObject *empty_list = 0;
23976  PyObject *module = 0;
23977  PyObject *global_dict = 0;
23978  PyObject *empty_dict = 0;
23979  PyObject *list;
23980  #if PY_MAJOR_VERSION < 3
23981  PyObject *py_import;
23982  py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
23983  if (!py_import)
23984  goto bad;
23985  #endif
23986  if (from_list)
23987  list = from_list;
23988  else {
23989  empty_list = PyList_New(0);
23990  if (!empty_list)
23991  goto bad;
23992  list = empty_list;
23993  }
23994  global_dict = PyModule_GetDict(__pyx_m);
23995  if (!global_dict)
23996  goto bad;
23997  empty_dict = PyDict_New();
23998  if (!empty_dict)
23999  goto bad;
24000  {
24001  #if PY_MAJOR_VERSION >= 3
24002  if (level == -1) {
24003  if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
24004  module = PyImport_ImportModuleLevelObject(
24005  name, global_dict, empty_dict, list, 1);
24006  if (!module) {
24007  if (!PyErr_ExceptionMatches(PyExc_ImportError))
24008  goto bad;
24009  PyErr_Clear();
24010  }
24011  }
24012  level = 0;
24013  }
24014  #endif
24015  if (!module) {
24016  #if PY_MAJOR_VERSION < 3
24017  PyObject *py_level = PyInt_FromLong(level);
24018  if (!py_level)
24019  goto bad;
24020  module = PyObject_CallFunctionObjArgs(py_import,
24021  name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
24022  Py_DECREF(py_level);
24023  #else
24024  module = PyImport_ImportModuleLevelObject(
24025  name, global_dict, empty_dict, list, level);
24026  #endif
24027  }
24028  }
24029 bad:
24030  #if PY_MAJOR_VERSION < 3
24031  Py_XDECREF(py_import);
24032  #endif
24033  Py_XDECREF(empty_list);
24034  Py_XDECREF(empty_dict);
24035  return module;
24036 }
24037 
24038 /* FastTypeChecks */
24039 #if CYTHON_COMPILING_IN_CPYTHON
24040 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
24041  while (a) {
24042  a = a->tp_base;
24043  if (a == b)
24044  return 1;
24045  }
24046  return b == &PyBaseObject_Type;
24047 }
24048 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
24049  PyObject *mro;
24050  if (a == b) return 1;
24051  mro = a->tp_mro;
24052  if (likely(mro)) {
24053  Py_ssize_t i, n;
24054  n = PyTuple_GET_SIZE(mro);
24055  for (i = 0; i < n; i++) {
24056  if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
24057  return 1;
24058  }
24059  return 0;
24060  }
24061  return __Pyx_InBases(a, b);
24062 }
24063 #if PY_MAJOR_VERSION == 2
24064 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
24065  PyObject *exception, *value, *tb;
24066  int res;
24067  __Pyx_PyThreadState_declare
24068  __Pyx_PyThreadState_assign
24069  __Pyx_ErrFetch(&exception, &value, &tb);
24070  res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
24071  if (unlikely(res == -1)) {
24072  PyErr_WriteUnraisable(err);
24073  res = 0;
24074  }
24075  if (!res) {
24076  res = PyObject_IsSubclass(err, exc_type2);
24077  if (unlikely(res == -1)) {
24078  PyErr_WriteUnraisable(err);
24079  res = 0;
24080  }
24081  }
24082  __Pyx_ErrRestore(exception, value, tb);
24083  return res;
24084 }
24085 #else
24086 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
24087  int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
24088  if (!res) {
24089  res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
24090  }
24091  return res;
24092 }
24093 #endif
24094 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
24095  Py_ssize_t i, n;
24096  assert(PyExceptionClass_Check(exc_type));
24097  n = PyTuple_GET_SIZE(tuple);
24098 #if PY_MAJOR_VERSION >= 3
24099  for (i=0; i<n; i++) {
24100  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
24101  }
24102 #endif
24103  for (i=0; i<n; i++) {
24104  PyObject *t = PyTuple_GET_ITEM(tuple, i);
24105  #if PY_MAJOR_VERSION < 3
24106  if (likely(exc_type == t)) return 1;
24107  #endif
24108  if (likely(PyExceptionClass_Check(t))) {
24109  if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
24110  } else {
24111  }
24112  }
24113  return 0;
24114 }
24115 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
24116  if (likely(err == exc_type)) return 1;
24117  if (likely(PyExceptionClass_Check(err))) {
24118  if (likely(PyExceptionClass_Check(exc_type))) {
24119  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
24120  } else if (likely(PyTuple_Check(exc_type))) {
24121  return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
24122  } else {
24123  }
24124  }
24125  return PyErr_GivenExceptionMatches(err, exc_type);
24126 }
24127 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
24128  assert(PyExceptionClass_Check(exc_type1));
24129  assert(PyExceptionClass_Check(exc_type2));
24130  if (likely(err == exc_type1 || err == exc_type2)) return 1;
24131  if (likely(PyExceptionClass_Check(err))) {
24132  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
24133  }
24134  return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
24135 }
24136 #endif
24137 
24138 /* PyIntBinop */
24139 #if !CYTHON_COMPILING_IN_PYPY
24140 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
24141  (void)inplace;
24142  (void)zerodivision_check;
24143  #if PY_MAJOR_VERSION < 3
24144  if (likely(PyInt_CheckExact(op1))) {
24145  const long b = intval;
24146  long x;
24147  long a = PyInt_AS_LONG(op1);
24148  x = (long)((unsigned long)a + b);
24149  if (likely((x^a) >= 0 || (x^b) >= 0))
24150  return PyInt_FromLong(x);
24151  return PyLong_Type.tp_as_number->nb_add(op1, op2);
24152  }
24153  #endif
24154  #if CYTHON_USE_PYLONG_INTERNALS
24155  if (likely(PyLong_CheckExact(op1))) {
24156  const long b = intval;
24157  long a, x;
24158 #ifdef HAVE_LONG_LONG
24159  const PY_LONG_LONG llb = intval;
24160  PY_LONG_LONG lla, llx;
24161 #endif
24162  const digit* digits = ((PyLongObject*)op1)->ob_digit;
24163  const Py_ssize_t size = Py_SIZE(op1);
24164  if (likely(__Pyx_sst_abs(size) <= 1)) {
24165  a = likely(size) ? digits[0] : 0;
24166  if (size == -1) a = -a;
24167  } else {
24168  switch (size) {
24169  case -2:
24170  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
24171  a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
24172  break;
24173 #ifdef HAVE_LONG_LONG
24174  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
24175  lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
24176  goto long_long;
24177 #endif
24178  }
24179  CYTHON_FALLTHROUGH;
24180  case 2:
24181  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
24182  a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
24183  break;
24184 #ifdef HAVE_LONG_LONG
24185  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
24186  lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
24187  goto long_long;
24188 #endif
24189  }
24190  CYTHON_FALLTHROUGH;
24191  case -3:
24192  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
24193  a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
24194  break;
24195 #ifdef HAVE_LONG_LONG
24196  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
24197  lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
24198  goto long_long;
24199 #endif
24200  }
24201  CYTHON_FALLTHROUGH;
24202  case 3:
24203  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
24204  a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
24205  break;
24206 #ifdef HAVE_LONG_LONG
24207  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
24208  lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
24209  goto long_long;
24210 #endif
24211  }
24212  CYTHON_FALLTHROUGH;
24213  case -4:
24214  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
24215  a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
24216  break;
24217 #ifdef HAVE_LONG_LONG
24218  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
24219  lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
24220  goto long_long;
24221 #endif
24222  }
24223  CYTHON_FALLTHROUGH;
24224  case 4:
24225  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
24226  a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
24227  break;
24228 #ifdef HAVE_LONG_LONG
24229  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
24230  lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
24231  goto long_long;
24232 #endif
24233  }
24234  CYTHON_FALLTHROUGH;
24235  default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
24236  }
24237  }
24238  x = a + b;
24239  return PyLong_FromLong(x);
24240 #ifdef HAVE_LONG_LONG
24241  long_long:
24242  llx = lla + llb;
24243  return PyLong_FromLongLong(llx);
24244 #endif
24245 
24246 
24247  }
24248  #endif
24249  if (PyFloat_CheckExact(op1)) {
24250  const long b = intval;
24251  double a = PyFloat_AS_DOUBLE(op1);
24252  double result;
24253  PyFPE_START_PROTECT("add", return NULL)
24254  result = ((double)a) + (double)b;
24255  PyFPE_END_PROTECT(result)
24256  return PyFloat_FromDouble(result);
24257  }
24258  return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
24259 }
24260 #endif
24261 
24262 /* None */
24263 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
24264  PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
24265 }
24266 
24267 /* ImportFrom */
24268 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
24269  PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
24270  if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
24271  PyErr_Format(PyExc_ImportError,
24272  #if PY_MAJOR_VERSION < 3
24273  "cannot import name %.230s", PyString_AS_STRING(name));
24274  #else
24275  "cannot import name %S", name);
24276  #endif
24277  }
24278  return value;
24279 }
24280 
24281 /* HasAttr */
24282 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
24283  PyObject *r;
24284  if (unlikely(!__Pyx_PyBaseString_Check(n))) {
24285  PyErr_SetString(PyExc_TypeError,
24286  "hasattr(): attribute name must be string");
24287  return -1;
24288  }
24289  r = __Pyx_GetAttr(o, n);
24290  if (unlikely(!r)) {
24291  PyErr_Clear();
24292  return 0;
24293  } else {
24294  Py_DECREF(r);
24295  return 1;
24296  }
24297 }
24298 
24299 /* PyObject_GenericGetAttrNoDict */
24300 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
24301 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
24302  PyErr_Format(PyExc_AttributeError,
24303 #if PY_MAJOR_VERSION >= 3
24304  "'%.50s' object has no attribute '%U'",
24305  tp->tp_name, attr_name);
24306 #else
24307  "'%.50s' object has no attribute '%.400s'",
24308  tp->tp_name, PyString_AS_STRING(attr_name));
24309 #endif
24310  return NULL;
24311 }
24312 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
24313  PyObject *descr;
24314  PyTypeObject *tp = Py_TYPE(obj);
24315  if (unlikely(!PyString_Check(attr_name))) {
24316  return PyObject_GenericGetAttr(obj, attr_name);
24317  }
24318  assert(!tp->tp_dictoffset);
24319  descr = _PyType_Lookup(tp, attr_name);
24320  if (unlikely(!descr)) {
24321  return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
24322  }
24323  Py_INCREF(descr);
24324  #if PY_MAJOR_VERSION < 3
24325  if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
24326  #endif
24327  {
24328  descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
24329  if (unlikely(f)) {
24330  PyObject *res = f(descr, obj, (PyObject *)tp);
24331  Py_DECREF(descr);
24332  return res;
24333  }
24334  }
24335  return descr;
24336 }
24337 #endif
24338 
24339 /* PyObject_GenericGetAttr */
24340 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
24341 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
24342  if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
24343  return PyObject_GenericGetAttr(obj, attr_name);
24344  }
24345  return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
24346 }
24347 #endif
24348 
24349 /* SetVTable */
24350 static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
24351 #if PY_VERSION_HEX >= 0x02070000
24352  PyObject *ob = PyCapsule_New(vtable, 0, 0);
24353 #else
24354  PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
24355 #endif
24356  if (!ob)
24357  goto bad;
24358  if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
24359  goto bad;
24360  Py_DECREF(ob);
24361  return 0;
24362 bad:
24363  Py_XDECREF(ob);
24364  return -1;
24365 }
24366 
24367 /* PyObjectGetAttrStrNoError */
24368 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
24369  __Pyx_PyThreadState_declare
24370  __Pyx_PyThreadState_assign
24371  if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
24372  __Pyx_PyErr_Clear();
24373 }
24374 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
24375  PyObject *result;
24376 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
24377  PyTypeObject* tp = Py_TYPE(obj);
24378  if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
24379  return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
24380  }
24381 #endif
24382  result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
24383  if (unlikely(!result)) {
24384  __Pyx_PyObject_GetAttrStr_ClearAttributeError();
24385  }
24386  return result;
24387 }
24388 
24389 /* SetupReduce */
24390 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
24391  int ret;
24392  PyObject *name_attr;
24393  name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
24394  if (likely(name_attr)) {
24395  ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
24396  } else {
24397  ret = -1;
24398  }
24399  if (unlikely(ret < 0)) {
24400  PyErr_Clear();
24401  ret = 0;
24402  }
24403  Py_XDECREF(name_attr);
24404  return ret;
24405 }
24406 static int __Pyx_setup_reduce(PyObject* type_obj) {
24407  int ret = 0;
24408  PyObject *object_reduce = NULL;
24409  PyObject *object_getstate = NULL;
24410  PyObject *object_reduce_ex = NULL;
24411  PyObject *reduce = NULL;
24412  PyObject *reduce_ex = NULL;
24413  PyObject *reduce_cython = NULL;
24414  PyObject *setstate = NULL;
24415  PyObject *setstate_cython = NULL;
24416  PyObject *getstate = NULL;
24417 #if CYTHON_USE_PYTYPE_LOOKUP
24418  getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate);
24419 #else
24420  getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate);
24421  if (!getstate && PyErr_Occurred()) {
24422  goto __PYX_BAD;
24423  }
24424 #endif
24425  if (getstate) {
24426 #if CYTHON_USE_PYTYPE_LOOKUP
24427  object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate);
24428 #else
24429  object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate);
24430  if (!object_getstate && PyErr_Occurred()) {
24431  goto __PYX_BAD;
24432  }
24433 #endif
24434  if (object_getstate != getstate) {
24435  goto __PYX_GOOD;
24436  }
24437  }
24438 #if CYTHON_USE_PYTYPE_LOOKUP
24439  object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
24440 #else
24441  object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
24442 #endif
24443  reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
24444  if (reduce_ex == object_reduce_ex) {
24445 #if CYTHON_USE_PYTYPE_LOOKUP
24446  object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
24447 #else
24448  object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
24449 #endif
24450  reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
24451  if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
24452  reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
24453  if (likely(reduce_cython)) {
24454  ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
24455  ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
24456  } else if (reduce == object_reduce || PyErr_Occurred()) {
24457  goto __PYX_BAD;
24458  }
24459  setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
24460  if (!setstate) PyErr_Clear();
24461  if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
24462  setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
24463  if (likely(setstate_cython)) {
24464  ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
24465  ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
24466  } else if (!setstate || PyErr_Occurred()) {
24467  goto __PYX_BAD;
24468  }
24469  }
24470  PyType_Modified((PyTypeObject*)type_obj);
24471  }
24472  }
24473  goto __PYX_GOOD;
24474 __PYX_BAD:
24475  if (!PyErr_Occurred())
24476  PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
24477  ret = -1;
24478 __PYX_GOOD:
24479 #if !CYTHON_USE_PYTYPE_LOOKUP
24480  Py_XDECREF(object_reduce);
24481  Py_XDECREF(object_reduce_ex);
24482  Py_XDECREF(object_getstate);
24483  Py_XDECREF(getstate);
24484 #endif
24485  Py_XDECREF(reduce);
24486  Py_XDECREF(reduce_ex);
24487  Py_XDECREF(reduce_cython);
24488  Py_XDECREF(setstate);
24489  Py_XDECREF(setstate_cython);
24490  return ret;
24491 }
24492 
24493 /* TypeImport */
24494 #ifndef __PYX_HAVE_RT_ImportType_0_29_36
24495 #define __PYX_HAVE_RT_ImportType_0_29_36
24496 static PyTypeObject *__Pyx_ImportType_0_29_36(PyObject *module, const char *module_name, const char *class_name,
24497  size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_0_29_36 check_size)
24498 {
24499  PyObject *result = 0;
24500  char warning[200];
24501  Py_ssize_t basicsize;
24502  Py_ssize_t itemsize;
24503 #ifdef Py_LIMITED_API
24504  PyObject *py_basicsize;
24505  PyObject *py_itemsize;
24506 #endif
24507  result = PyObject_GetAttrString(module, class_name);
24508  if (!result)
24509  goto bad;
24510  if (!PyType_Check(result)) {
24511  PyErr_Format(PyExc_TypeError,
24512  "%.200s.%.200s is not a type object",
24513  module_name, class_name);
24514  goto bad;
24515  }
24516 #ifndef Py_LIMITED_API
24517  basicsize = ((PyTypeObject *)result)->tp_basicsize;
24518  itemsize = ((PyTypeObject *)result)->tp_itemsize;
24519 #else
24520  py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
24521  if (!py_basicsize)
24522  goto bad;
24523  basicsize = PyLong_AsSsize_t(py_basicsize);
24524  Py_DECREF(py_basicsize);
24525  py_basicsize = 0;
24526  if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
24527  goto bad;
24528  py_itemsize = PyObject_GetAttrString(result, "__itemsize__");
24529  if (!py_itemsize)
24530  goto bad;
24531  itemsize = PyLong_AsSsize_t(py_itemsize);
24532  Py_DECREF(py_itemsize);
24533  py_itemsize = 0;
24534  if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred())
24535  goto bad;
24536 #endif
24537  if (itemsize) {
24538  if (size % alignment) {
24539  alignment = size % alignment;
24540  }
24541  if (itemsize < (Py_ssize_t)alignment)
24542  itemsize = (Py_ssize_t)alignment;
24543  }
24544  if ((size_t)(basicsize + itemsize) < size) {
24545  PyErr_Format(PyExc_ValueError,
24546  "%.200s.%.200s size changed, may indicate binary incompatibility. "
24547  "Expected %zd from C header, got %zd from PyObject",
24548  module_name, class_name, size, basicsize);
24549  goto bad;
24550  }
24551  if (check_size == __Pyx_ImportType_CheckSize_Error_0_29_36 && (size_t)basicsize != size) {
24552  PyErr_Format(PyExc_ValueError,
24553  "%.200s.%.200s size changed, may indicate binary incompatibility. "
24554  "Expected %zd from C header, got %zd from PyObject",
24555  module_name, class_name, size, basicsize);
24556  goto bad;
24557  }
24558  else if (check_size == __Pyx_ImportType_CheckSize_Warn_0_29_36 && (size_t)basicsize > size) {
24559  PyOS_snprintf(warning, sizeof(warning),
24560  "%s.%s size changed, may indicate binary incompatibility. "
24561  "Expected %zd from C header, got %zd from PyObject",
24562  module_name, class_name, size, basicsize);
24563  if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
24564  }
24565  return (PyTypeObject *)result;
24566 bad:
24567  Py_XDECREF(result);
24568  return NULL;
24569 }
24570 #endif
24571 
24572 /* GetVTable */
24573 static void* __Pyx_GetVtable(PyObject *dict) {
24574  void* ptr;
24575  PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable);
24576  if (!ob)
24577  goto bad;
24578 #if PY_VERSION_HEX >= 0x02070000
24579  ptr = PyCapsule_GetPointer(ob, 0);
24580 #else
24581  ptr = PyCObject_AsVoidPtr(ob);
24582 #endif
24583  if (!ptr && !PyErr_Occurred())
24584  PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
24585  Py_DECREF(ob);
24586  return ptr;
24587 bad:
24588  Py_XDECREF(ob);
24589  return NULL;
24590 }
24591 
24592 /* FetchCommonType */
24593 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
24594  PyObject* fake_module;
24595  PyTypeObject* cached_type = NULL;
24596  fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
24597  if (!fake_module) return NULL;
24598  Py_INCREF(fake_module);
24599  cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
24600  if (cached_type) {
24601  if (!PyType_Check((PyObject*)cached_type)) {
24602  PyErr_Format(PyExc_TypeError,
24603  "Shared Cython type %.200s is not a type object",
24604  type->tp_name);
24605  goto bad;
24606  }
24607  if (cached_type->tp_basicsize != type->tp_basicsize) {
24608  PyErr_Format(PyExc_TypeError,
24609  "Shared Cython type %.200s has the wrong size, try recompiling",
24610  type->tp_name);
24611  goto bad;
24612  }
24613  } else {
24614  if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
24615  PyErr_Clear();
24616  if (PyType_Ready(type) < 0) goto bad;
24617  if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
24618  goto bad;
24619  Py_INCREF(type);
24620  cached_type = type;
24621  }
24622 done:
24623  Py_DECREF(fake_module);
24624  return cached_type;
24625 bad:
24626  Py_XDECREF(cached_type);
24627  cached_type = NULL;
24628  goto done;
24629 }
24630 
24631 /* CythonFunctionShared */
24632 #include <structmember.h>
24633 static PyObject *
24634 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
24635 {
24636  if (unlikely(op->func_doc == NULL)) {
24637  if (op->func.m_ml->ml_doc) {
24638 #if PY_MAJOR_VERSION >= 3
24639  op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
24640 #else
24641  op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
24642 #endif
24643  if (unlikely(op->func_doc == NULL))
24644  return NULL;
24645  } else {
24646  Py_INCREF(Py_None);
24647  return Py_None;
24648  }
24649  }
24650  Py_INCREF(op->func_doc);
24651  return op->func_doc;
24652 }
24653 static int
24654 __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
24655 {
24656  PyObject *tmp = op->func_doc;
24657  if (value == NULL) {
24658  value = Py_None;
24659  }
24660  Py_INCREF(value);
24661  op->func_doc = value;
24662  Py_XDECREF(tmp);
24663  return 0;
24664 }
24665 static PyObject *
24666 __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
24667 {
24668  if (unlikely(op->func_name == NULL)) {
24669 #if PY_MAJOR_VERSION >= 3
24670  op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
24671 #else
24672  op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
24673 #endif
24674  if (unlikely(op->func_name == NULL))
24675  return NULL;
24676  }
24677  Py_INCREF(op->func_name);
24678  return op->func_name;
24679 }
24680 static int
24681 __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
24682 {
24683  PyObject *tmp;
24684 #if PY_MAJOR_VERSION >= 3
24685  if (unlikely(value == NULL || !PyUnicode_Check(value)))
24686 #else
24687  if (unlikely(value == NULL || !PyString_Check(value)))
24688 #endif
24689  {
24690  PyErr_SetString(PyExc_TypeError,
24691  "__name__ must be set to a string object");
24692  return -1;
24693  }
24694  tmp = op->func_name;
24695  Py_INCREF(value);
24696  op->func_name = value;
24697  Py_XDECREF(tmp);
24698  return 0;
24699 }
24700 static PyObject *
24701 __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
24702 {
24703  Py_INCREF(op->func_qualname);
24704  return op->func_qualname;
24705 }
24706 static int
24707 __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
24708 {
24709  PyObject *tmp;
24710 #if PY_MAJOR_VERSION >= 3
24711  if (unlikely(value == NULL || !PyUnicode_Check(value)))
24712 #else
24713  if (unlikely(value == NULL || !PyString_Check(value)))
24714 #endif
24715  {
24716  PyErr_SetString(PyExc_TypeError,
24717  "__qualname__ must be set to a string object");
24718  return -1;
24719  }
24720  tmp = op->func_qualname;
24721  Py_INCREF(value);
24722  op->func_qualname = value;
24723  Py_XDECREF(tmp);
24724  return 0;
24725 }
24726 static PyObject *
24727 __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
24728 {
24729  PyObject *self;
24730  self = m->func_closure;
24731  if (self == NULL)
24732  self = Py_None;
24733  Py_INCREF(self);
24734  return self;
24735 }
24736 static PyObject *
24737 __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
24738 {
24739  if (unlikely(op->func_dict == NULL)) {
24740  op->func_dict = PyDict_New();
24741  if (unlikely(op->func_dict == NULL))
24742  return NULL;
24743  }
24744  Py_INCREF(op->func_dict);
24745  return op->func_dict;
24746 }
24747 static int
24748 __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
24749 {
24750  PyObject *tmp;
24751  if (unlikely(value == NULL)) {
24752  PyErr_SetString(PyExc_TypeError,
24753  "function's dictionary may not be deleted");
24754  return -1;
24755  }
24756  if (unlikely(!PyDict_Check(value))) {
24757  PyErr_SetString(PyExc_TypeError,
24758  "setting function's dictionary to a non-dict");
24759  return -1;
24760  }
24761  tmp = op->func_dict;
24762  Py_INCREF(value);
24763  op->func_dict = value;
24764  Py_XDECREF(tmp);
24765  return 0;
24766 }
24767 static PyObject *
24768 __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
24769 {
24770  Py_INCREF(op->func_globals);
24771  return op->func_globals;
24772 }
24773 static PyObject *
24774 __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
24775 {
24776  Py_INCREF(Py_None);
24777  return Py_None;
24778 }
24779 static PyObject *
24780 __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
24781 {
24782  PyObject* result = (op->func_code) ? op->func_code : Py_None;
24783  Py_INCREF(result);
24784  return result;
24785 }
24786 static int
24787 __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
24788  int result = 0;
24789  PyObject *res = op->defaults_getter((PyObject *) op);
24790  if (unlikely(!res))
24791  return -1;
24792  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24793  op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
24794  Py_INCREF(op->defaults_tuple);
24795  op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
24796  Py_INCREF(op->defaults_kwdict);
24797  #else
24798  op->defaults_tuple = PySequence_ITEM(res, 0);
24799  if (unlikely(!op->defaults_tuple)) result = -1;
24800  else {
24801  op->defaults_kwdict = PySequence_ITEM(res, 1);
24802  if (unlikely(!op->defaults_kwdict)) result = -1;
24803  }
24804  #endif
24805  Py_DECREF(res);
24806  return result;
24807 }
24808 static int
24809 __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
24810  PyObject* tmp;
24811  if (!value) {
24812  value = Py_None;
24813  } else if (value != Py_None && !PyTuple_Check(value)) {
24814  PyErr_SetString(PyExc_TypeError,
24815  "__defaults__ must be set to a tuple object");
24816  return -1;
24817  }
24818  Py_INCREF(value);
24819  tmp = op->defaults_tuple;
24820  op->defaults_tuple = value;
24821  Py_XDECREF(tmp);
24822  return 0;
24823 }
24824 static PyObject *
24825 __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
24826  PyObject* result = op->defaults_tuple;
24827  if (unlikely(!result)) {
24828  if (op->defaults_getter) {
24829  if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
24830  result = op->defaults_tuple;
24831  } else {
24832  result = Py_None;
24833  }
24834  }
24835  Py_INCREF(result);
24836  return result;
24837 }
24838 static int
24839 __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
24840  PyObject* tmp;
24841  if (!value) {
24842  value = Py_None;
24843  } else if (value != Py_None && !PyDict_Check(value)) {
24844  PyErr_SetString(PyExc_TypeError,
24845  "__kwdefaults__ must be set to a dict object");
24846  return -1;
24847  }
24848  Py_INCREF(value);
24849  tmp = op->defaults_kwdict;
24850  op->defaults_kwdict = value;
24851  Py_XDECREF(tmp);
24852  return 0;
24853 }
24854 static PyObject *
24855 __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
24856  PyObject* result = op->defaults_kwdict;
24857  if (unlikely(!result)) {
24858  if (op->defaults_getter) {
24859  if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
24860  result = op->defaults_kwdict;
24861  } else {
24862  result = Py_None;
24863  }
24864  }
24865  Py_INCREF(result);
24866  return result;
24867 }
24868 static int
24869 __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
24870  PyObject* tmp;
24871  if (!value || value == Py_None) {
24872  value = NULL;
24873  } else if (!PyDict_Check(value)) {
24874  PyErr_SetString(PyExc_TypeError,
24875  "__annotations__ must be set to a dict object");
24876  return -1;
24877  }
24878  Py_XINCREF(value);
24879  tmp = op->func_annotations;
24880  op->func_annotations = value;
24881  Py_XDECREF(tmp);
24882  return 0;
24883 }
24884 static PyObject *
24885 __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
24886  PyObject* result = op->func_annotations;
24887  if (unlikely(!result)) {
24888  result = PyDict_New();
24889  if (unlikely(!result)) return NULL;
24890  op->func_annotations = result;
24891  }
24892  Py_INCREF(result);
24893  return result;
24894 }
24895 static PyGetSetDef __pyx_CyFunction_getsets[] = {
24896  {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
24897  {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
24898  {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
24899  {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
24900  {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
24901  {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
24902  {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
24903  {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
24904  {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
24905  {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
24906  {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
24907  {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
24908  {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
24909  {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
24910  {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
24911  {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
24912  {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
24913  {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
24914  {0, 0, 0, 0, 0}
24915 };
24916 static PyMemberDef __pyx_CyFunction_members[] = {
24917  {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
24918  {0, 0, 0, 0, 0}
24919 };
24920 static PyObject *
24921 __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
24922 {
24923 #if PY_MAJOR_VERSION >= 3
24924  Py_INCREF(m->func_qualname);
24925  return m->func_qualname;
24926 #else
24927  return PyString_FromString(m->func.m_ml->ml_name);
24928 #endif
24929 }
24930 static PyMethodDef __pyx_CyFunction_methods[] = {
24931  {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
24932  {0, 0, 0, 0}
24933 };
24934 #if PY_VERSION_HEX < 0x030500A0
24935 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
24936 #else
24937 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
24938 #endif
24939 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname,
24940  PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
24941  if (unlikely(op == NULL))
24942  return NULL;
24943  op->flags = flags;
24944  __Pyx_CyFunction_weakreflist(op) = NULL;
24945  op->func.m_ml = ml;
24946  op->func.m_self = (PyObject *) op;
24947  Py_XINCREF(closure);
24948  op->func_closure = closure;
24949  Py_XINCREF(module);
24950  op->func.m_module = module;
24951  op->func_dict = NULL;
24952  op->func_name = NULL;
24953  Py_INCREF(qualname);
24954  op->func_qualname = qualname;
24955  op->func_doc = NULL;
24956  op->func_classobj = NULL;
24957  op->func_globals = globals;
24958  Py_INCREF(op->func_globals);
24959  Py_XINCREF(code);
24960  op->func_code = code;
24961  op->defaults_pyobjects = 0;
24962  op->defaults_size = 0;
24963  op->defaults = NULL;
24964  op->defaults_tuple = NULL;
24965  op->defaults_kwdict = NULL;
24966  op->defaults_getter = NULL;
24967  op->func_annotations = NULL;
24968  return (PyObject *) op;
24969 }
24970 static int
24971 __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
24972 {
24973  Py_CLEAR(m->func_closure);
24974  Py_CLEAR(m->func.m_module);
24975  Py_CLEAR(m->func_dict);
24976  Py_CLEAR(m->func_name);
24977  Py_CLEAR(m->func_qualname);
24978  Py_CLEAR(m->func_doc);
24979  Py_CLEAR(m->func_globals);
24980  Py_CLEAR(m->func_code);
24981  Py_CLEAR(m->func_classobj);
24982  Py_CLEAR(m->defaults_tuple);
24983  Py_CLEAR(m->defaults_kwdict);
24984  Py_CLEAR(m->func_annotations);
24985  if (m->defaults) {
24986  PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
24987  int i;
24988  for (i = 0; i < m->defaults_pyobjects; i++)
24989  Py_XDECREF(pydefaults[i]);
24990  PyObject_Free(m->defaults);
24991  m->defaults = NULL;
24992  }
24993  return 0;
24994 }
24995 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
24996 {
24997  if (__Pyx_CyFunction_weakreflist(m) != NULL)
24998  PyObject_ClearWeakRefs((PyObject *) m);
24999  __Pyx_CyFunction_clear(m);
25000  PyObject_GC_Del(m);
25001 }
25002 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
25003 {
25004  PyObject_GC_UnTrack(m);
25005  __Pyx__CyFunction_dealloc(m);
25006 }
25007 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
25008 {
25009  Py_VISIT(m->func_closure);
25010  Py_VISIT(m->func.m_module);
25011  Py_VISIT(m->func_dict);
25012  Py_VISIT(m->func_name);
25013  Py_VISIT(m->func_qualname);
25014  Py_VISIT(m->func_doc);
25015  Py_VISIT(m->func_globals);
25016  Py_VISIT(m->func_code);
25017  Py_VISIT(m->func_classobj);
25018  Py_VISIT(m->defaults_tuple);
25019  Py_VISIT(m->defaults_kwdict);
25020  if (m->defaults) {
25021  PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
25022  int i;
25023  for (i = 0; i < m->defaults_pyobjects; i++)
25024  Py_VISIT(pydefaults[i]);
25025  }
25026  return 0;
25027 }
25028 static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
25029 {
25030 #if PY_MAJOR_VERSION < 3
25031  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25032  if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
25033  Py_INCREF(func);
25034  return func;
25035  }
25036  if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
25037  if (type == NULL)
25038  type = (PyObject *)(Py_TYPE(obj));
25039  return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
25040  }
25041  if (obj == Py_None)
25042  obj = NULL;
25043 #endif
25044  return __Pyx_PyMethod_New(func, obj, type);
25045 }
25046 static PyObject*
25047 __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
25048 {
25049 #if PY_MAJOR_VERSION >= 3
25050  return PyUnicode_FromFormat("<cyfunction %U at %p>",
25051  op->func_qualname, (void *)op);
25052 #else
25053  return PyString_FromFormat("<cyfunction %s at %p>",
25054  PyString_AsString(op->func_qualname), (void *)op);
25055 #endif
25056 }
25057 static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
25058  PyCFunctionObject* f = (PyCFunctionObject*)func;
25059  PyCFunction meth = f->m_ml->ml_meth;
25060  Py_ssize_t size;
25061  switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
25062  case METH_VARARGS:
25063  if (likely(kw == NULL || PyDict_Size(kw) == 0))
25064  return (*meth)(self, arg);
25065  break;
25066  case METH_VARARGS | METH_KEYWORDS:
25067  return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
25068  case METH_NOARGS:
25069  if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
25070  size = PyTuple_GET_SIZE(arg);
25071  if (likely(size == 0))
25072  return (*meth)(self, NULL);
25073  PyErr_Format(PyExc_TypeError,
25074  "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
25075  f->m_ml->ml_name, size);
25076  return NULL;
25077  }
25078  break;
25079  case METH_O:
25080  if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
25081  size = PyTuple_GET_SIZE(arg);
25082  if (likely(size == 1)) {
25083  PyObject *result, *arg0;
25084  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
25085  arg0 = PyTuple_GET_ITEM(arg, 0);
25086  #else
25087  arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
25088  #endif
25089  result = (*meth)(self, arg0);
25090  #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
25091  Py_DECREF(arg0);
25092  #endif
25093  return result;
25094  }
25095  PyErr_Format(PyExc_TypeError,
25096  "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
25097  f->m_ml->ml_name, size);
25098  return NULL;
25099  }
25100  break;
25101  default:
25102  PyErr_SetString(PyExc_SystemError, "Bad call flags in "
25103  "__Pyx_CyFunction_Call. METH_OLDARGS is no "
25104  "longer supported!");
25105  return NULL;
25106  }
25107  PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
25108  f->m_ml->ml_name);
25109  return NULL;
25110 }
25111 static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
25112  return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
25113 }
25114 static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
25115  PyObject *result;
25116  __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
25117  if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
25118  Py_ssize_t argc;
25119  PyObject *new_args;
25120  PyObject *self;
25121  argc = PyTuple_GET_SIZE(args);
25122  new_args = PyTuple_GetSlice(args, 1, argc);
25123  if (unlikely(!new_args))
25124  return NULL;
25125  self = PyTuple_GetItem(args, 0);
25126  if (unlikely(!self)) {
25127  Py_DECREF(new_args);
25128 #if PY_MAJOR_VERSION > 2
25129  PyErr_Format(PyExc_TypeError,
25130  "unbound method %.200S() needs an argument",
25131  cyfunc->func_qualname);
25132 #else
25133  PyErr_SetString(PyExc_TypeError,
25134  "unbound method needs an argument");
25135 #endif
25136  return NULL;
25137  }
25138  result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
25139  Py_DECREF(new_args);
25140  } else {
25141  result = __Pyx_CyFunction_Call(func, args, kw);
25142  }
25143  return result;
25144 }
25145 static PyTypeObject __pyx_CyFunctionType_type = {
25146  PyVarObject_HEAD_INIT(0, 0)
25147  "cython_function_or_method",
25148  sizeof(__pyx_CyFunctionObject),
25149  0,
25150  (destructor) __Pyx_CyFunction_dealloc,
25151  0,
25152  0,
25153  0,
25154 #if PY_MAJOR_VERSION < 3
25155  0,
25156 #else
25157  0,
25158 #endif
25159  (reprfunc) __Pyx_CyFunction_repr,
25160  0,
25161  0,
25162  0,
25163  0,
25164  __Pyx_CyFunction_CallAsMethod,
25165  0,
25166  0,
25167  0,
25168  0,
25169  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
25170  0,
25171  (traverseproc) __Pyx_CyFunction_traverse,
25172  (inquiry) __Pyx_CyFunction_clear,
25173  0,
25174 #if PY_VERSION_HEX < 0x030500A0
25175  offsetof(__pyx_CyFunctionObject, func_weakreflist),
25176 #else
25177  offsetof(PyCFunctionObject, m_weakreflist),
25178 #endif
25179  0,
25180  0,
25181  __pyx_CyFunction_methods,
25182  __pyx_CyFunction_members,
25183  __pyx_CyFunction_getsets,
25184  0,
25185  0,
25186  __Pyx_CyFunction_descr_get,
25187  0,
25188  offsetof(__pyx_CyFunctionObject, func_dict),
25189  0,
25190  0,
25191  0,
25192  0,
25193  0,
25194  0,
25195  0,
25196  0,
25197  0,
25198  0,
25199  0,
25200  0,
25201 #if PY_VERSION_HEX >= 0x030400a1
25202  0,
25203 #endif
25204 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
25205  0,
25206 #endif
25207 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
25208  0,
25209 #endif
25210 #if PY_VERSION_HEX >= 0x030C0000
25211  0,
25212 #endif
25213 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
25214  0,
25215 #endif
25216 };
25217 static int __pyx_CyFunction_init(void) {
25218  __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
25219  if (unlikely(__pyx_CyFunctionType == NULL)) {
25220  return -1;
25221  }
25222  return 0;
25223 }
25224 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
25225  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25226  m->defaults = PyObject_Malloc(size);
25227  if (unlikely(!m->defaults))
25228  return PyErr_NoMemory();
25229  memset(m->defaults, 0, size);
25230  m->defaults_pyobjects = pyobjects;
25231  m->defaults_size = size;
25232  return m->defaults;
25233 }
25234 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
25235  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25236  m->defaults_tuple = tuple;
25237  Py_INCREF(tuple);
25238 }
25239 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
25240  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25241  m->defaults_kwdict = dict;
25242  Py_INCREF(dict);
25243 }
25244 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
25245  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25246  m->func_annotations = dict;
25247  Py_INCREF(dict);
25248 }
25249 
25250 /* CythonFunction */
25251 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
25252  PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
25253  PyObject *op = __Pyx_CyFunction_Init(
25254  PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
25255  ml, flags, qualname, closure, module, globals, code
25256  );
25257  if (likely(op)) {
25258  PyObject_GC_Track(op);
25259  }
25260  return op;
25261 }
25262 
25263 /* CLineInTraceback */
25264 #ifndef CYTHON_CLINE_IN_TRACEBACK
25265 static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_line) {
25266  PyObject *use_cline;
25267  PyObject *ptype, *pvalue, *ptraceback;
25268 #if CYTHON_COMPILING_IN_CPYTHON
25269  PyObject **cython_runtime_dict;
25270 #endif
25271  if (unlikely(!__pyx_cython_runtime)) {
25272  return c_line;
25273  }
25274  __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
25275 #if CYTHON_COMPILING_IN_CPYTHON
25276  cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
25277  if (likely(cython_runtime_dict)) {
25278  __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
25279  use_cline, *cython_runtime_dict,
25280  __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
25281  } else
25282 #endif
25283  {
25284  PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
25285  if (use_cline_obj) {
25286  use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
25287  Py_DECREF(use_cline_obj);
25288  } else {
25289  PyErr_Clear();
25290  use_cline = NULL;
25291  }
25292  }
25293  if (!use_cline) {
25294  c_line = 0;
25295  (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
25296  }
25297  else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
25298  c_line = 0;
25299  }
25300  __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
25301  return c_line;
25302 }
25303 #endif
25304 
25305 /* CodeObjectCache */
25306 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
25307  int start = 0, mid = 0, end = count - 1;
25308  if (end >= 0 && code_line > entries[end].code_line) {
25309  return count;
25310  }
25311  while (start < end) {
25312  mid = start + (end - start) / 2;
25313  if (code_line < entries[mid].code_line) {
25314  end = mid;
25315  } else if (code_line > entries[mid].code_line) {
25316  start = mid + 1;
25317  } else {
25318  return mid;
25319  }
25320  }
25321  if (code_line <= entries[mid].code_line) {
25322  return mid;
25323  } else {
25324  return mid + 1;
25325  }
25326 }
25327 static PyCodeObject *__pyx_find_code_object(int code_line) {
25328  PyCodeObject* code_object;
25329  int pos;
25330  if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
25331  return NULL;
25332  }
25333  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
25334  if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
25335  return NULL;
25336  }
25337  code_object = __pyx_code_cache.entries[pos].code_object;
25338  Py_INCREF(code_object);
25339  return code_object;
25340 }
25341 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
25342  int pos, i;
25343  __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
25344  if (unlikely(!code_line)) {
25345  return;
25346  }
25347  if (unlikely(!entries)) {
25348  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
25349  if (likely(entries)) {
25350  __pyx_code_cache.entries = entries;
25351  __pyx_code_cache.max_count = 64;
25352  __pyx_code_cache.count = 1;
25353  entries[0].code_line = code_line;
25354  entries[0].code_object = code_object;
25355  Py_INCREF(code_object);
25356  }
25357  return;
25358  }
25359  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
25360  if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
25361  PyCodeObject* tmp = entries[pos].code_object;
25362  entries[pos].code_object = code_object;
25363  Py_DECREF(tmp);
25364  return;
25365  }
25366  if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
25367  int new_max = __pyx_code_cache.max_count + 64;
25368  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
25369  __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
25370  if (unlikely(!entries)) {
25371  return;
25372  }
25373  __pyx_code_cache.entries = entries;
25374  __pyx_code_cache.max_count = new_max;
25375  }
25376  for (i=__pyx_code_cache.count; i>pos; i--) {
25377  entries[i] = entries[i-1];
25378  }
25379  entries[pos].code_line = code_line;
25380  entries[pos].code_object = code_object;
25381  __pyx_code_cache.count++;
25382  Py_INCREF(code_object);
25383 }
25384 
25385 /* AddTraceback */
25386 #include "compile.h"
25387 #include "frameobject.h"
25388 #include "traceback.h"
25389 #if PY_VERSION_HEX >= 0x030b00a6
25390  #ifndef Py_BUILD_CORE
25391  #define Py_BUILD_CORE 1
25392  #endif
25393  #include "internal/pycore_frame.h"
25394 #endif
25395 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
25396  const char *funcname, int c_line,
25397  int py_line, const char *filename) {
25398  PyCodeObject *py_code = NULL;
25399  PyObject *py_funcname = NULL;
25400  #if PY_MAJOR_VERSION < 3
25401  PyObject *py_srcfile = NULL;
25402  py_srcfile = PyString_FromString(filename);
25403  if (!py_srcfile) goto bad;
25404  #endif
25405  if (c_line) {
25406  #if PY_MAJOR_VERSION < 3
25407  py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
25408  if (!py_funcname) goto bad;
25409  #else
25410  py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
25411  if (!py_funcname) goto bad;
25412  funcname = PyUnicode_AsUTF8(py_funcname);
25413  if (!funcname) goto bad;
25414  #endif
25415  }
25416  else {
25417  #if PY_MAJOR_VERSION < 3
25418  py_funcname = PyString_FromString(funcname);
25419  if (!py_funcname) goto bad;
25420  #endif
25421  }
25422  #if PY_MAJOR_VERSION < 3
25423  py_code = __Pyx_PyCode_New(
25424  0,
25425  0,
25426  0,
25427  0,
25428  0,
25429  __pyx_empty_bytes, /*PyObject *code,*/
25430  __pyx_empty_tuple, /*PyObject *consts,*/
25431  __pyx_empty_tuple, /*PyObject *names,*/
25432  __pyx_empty_tuple, /*PyObject *varnames,*/
25433  __pyx_empty_tuple, /*PyObject *freevars,*/
25434  __pyx_empty_tuple, /*PyObject *cellvars,*/
25435  py_srcfile, /*PyObject *filename,*/
25436  py_funcname, /*PyObject *name,*/
25437  py_line,
25438  __pyx_empty_bytes /*PyObject *lnotab*/
25439  );
25440  Py_DECREF(py_srcfile);
25441  #else
25442  py_code = PyCode_NewEmpty(filename, funcname, py_line);
25443  #endif
25444  Py_XDECREF(py_funcname); // XDECREF since it's only set on Py3 if cline
25445  return py_code;
25446 bad:
25447  Py_XDECREF(py_funcname);
25448  #if PY_MAJOR_VERSION < 3
25449  Py_XDECREF(py_srcfile);
25450  #endif
25451  return NULL;
25452 }
25453 static void __Pyx_AddTraceback(const char *funcname, int c_line,
25454  int py_line, const char *filename) {
25455  PyCodeObject *py_code = 0;
25456  PyFrameObject *py_frame = 0;
25457  PyThreadState *tstate = __Pyx_PyThreadState_Current;
25458  PyObject *ptype, *pvalue, *ptraceback;
25459  if (c_line) {
25460  c_line = __Pyx_CLineForTraceback(tstate, c_line);
25461  }
25462  py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
25463  if (!py_code) {
25464  __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
25465  py_code = __Pyx_CreateCodeObjectForTraceback(
25466  funcname, c_line, py_line, filename);
25467  if (!py_code) {
25468  /* If the code object creation fails, then we should clear the
25469  fetched exception references and propagate the new exception */
25470  Py_XDECREF(ptype);
25471  Py_XDECREF(pvalue);
25472  Py_XDECREF(ptraceback);
25473  goto bad;
25474  }
25475  __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
25476  __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
25477  }
25478  py_frame = PyFrame_New(
25479  tstate, /*PyThreadState *tstate,*/
25480  py_code, /*PyCodeObject *code,*/
25481  __pyx_d, /*PyObject *globals,*/
25482  0 /*PyObject *locals*/
25483  );
25484  if (!py_frame) goto bad;
25485  __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
25486  PyTraceBack_Here(py_frame);
25487 bad:
25488  Py_XDECREF(py_code);
25489  Py_XDECREF(py_frame);
25490 }
25491 
25492 #if PY_MAJOR_VERSION < 3
25493 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
25494  if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
25495  if (__Pyx_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags);
25496  if (__Pyx_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags);
25497  PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
25498  return -1;
25499 }
25500 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
25501  PyObject *obj = view->obj;
25502  if (!obj) return;
25503  if (PyObject_CheckBuffer(obj)) {
25504  PyBuffer_Release(view);
25505  return;
25506  }
25507  if ((0)) {}
25508  view->obj = NULL;
25509  Py_DECREF(obj);
25510 }
25511 #endif
25512 
25513 
25514 /* MemviewSliceIsContig */
25515 static int
25516 __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim)
25517 {
25518  int i, index, step, start;
25519  Py_ssize_t itemsize = mvs.memview->view.itemsize;
25520  if (order == 'F') {
25521  step = 1;
25522  start = 0;
25523  } else {
25524  step = -1;
25525  start = ndim - 1;
25526  }
25527  for (i = 0; i < ndim; i++) {
25528  index = start + step * i;
25529  if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
25530  return 0;
25531  itemsize *= mvs.shape[index];
25532  }
25533  return 1;
25534 }
25535 
25536 /* OverlappingSlices */
25537 static void
25538 __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
25539  void **out_start, void **out_end,
25540  int ndim, size_t itemsize)
25541 {
25542  char *start, *end;
25543  int i;
25544  start = end = slice->data;
25545  for (i = 0; i < ndim; i++) {
25546  Py_ssize_t stride = slice->strides[i];
25547  Py_ssize_t extent = slice->shape[i];
25548  if (extent == 0) {
25549  *out_start = *out_end = start;
25550  return;
25551  } else {
25552  if (stride > 0)
25553  end += stride * (extent - 1);
25554  else
25555  start += stride * (extent - 1);
25556  }
25557  }
25558  *out_start = start;
25559  *out_end = end + itemsize;
25560 }
25561 static int
25562 __pyx_slices_overlap(__Pyx_memviewslice *slice1,
25563  __Pyx_memviewslice *slice2,
25564  int ndim, size_t itemsize)
25565 {
25566  void *start1, *end1, *start2, *end2;
25567  __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
25568  __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
25569  return (start1 < end2) && (start2 < end1);
25570 }
25571 
25572 /* Capsule */
25573 static CYTHON_INLINE PyObject *
25574 __pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig)
25575 {
25576  PyObject *cobj;
25577 #if PY_VERSION_HEX >= 0x02070000
25578  cobj = PyCapsule_New(p, sig, NULL);
25579 #else
25580  cobj = PyCObject_FromVoidPtr(p, NULL);
25581 #endif
25582  return cobj;
25583 }
25584 
25585 /* CIntFromPyVerify */
25586 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
25587  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
25588 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
25589  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
25590 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
25591  {\
25592  func_type value = func_value;\
25593  if (sizeof(target_type) < sizeof(func_type)) {\
25594  if (unlikely(value != (func_type) (target_type) value)) {\
25595  func_type zero = 0;\
25596  if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
25597  return (target_type) -1;\
25598  if (is_unsigned && unlikely(value < zero))\
25599  goto raise_neg_overflow;\
25600  else\
25601  goto raise_overflow;\
25602  }\
25603  }\
25604  return (target_type) value;\
25605  }
25606 
25607 /* IsLittleEndian */
25608 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void)
25609 {
25610  union {
25611  uint32_t u32;
25612  uint8_t u8[4];
25613  } S;
25614  S.u32 = 0x01020304;
25615  return S.u8[0] == 4;
25616 }
25617 
25618 /* BufferFormatCheck */
25619 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
25620  __Pyx_BufFmt_StackElem* stack,
25621  __Pyx_TypeInfo* type) {
25622  stack[0].field = &ctx->root;
25623  stack[0].parent_offset = 0;
25624  ctx->root.type = type;
25625  ctx->root.name = "buffer dtype";
25626  ctx->root.offset = 0;
25627  ctx->head = stack;
25628  ctx->head->field = &ctx->root;
25629  ctx->fmt_offset = 0;
25630  ctx->head->parent_offset = 0;
25631  ctx->new_packmode = '@';
25632  ctx->enc_packmode = '@';
25633  ctx->new_count = 1;
25634  ctx->enc_count = 0;
25635  ctx->enc_type = 0;
25636  ctx->is_complex = 0;
25637  ctx->is_valid_array = 0;
25638  ctx->struct_alignment = 0;
25639  while (type->typegroup == 'S') {
25640  ++ctx->head;
25641  ctx->head->field = type->fields;
25642  ctx->head->parent_offset = 0;
25643  type = type->fields->type;
25644  }
25645 }
25646 static int __Pyx_BufFmt_ParseNumber(const char** ts) {
25647  int count;
25648  const char* t = *ts;
25649  if (*t < '0' || *t > '9') {
25650  return -1;
25651  } else {
25652  count = *t++ - '0';
25653  while (*t >= '0' && *t <= '9') {
25654  count *= 10;
25655  count += *t++ - '0';
25656  }
25657  }
25658  *ts = t;
25659  return count;
25660 }
25661 static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
25662  int number = __Pyx_BufFmt_ParseNumber(ts);
25663  if (number == -1)
25664  PyErr_Format(PyExc_ValueError,\
25665  "Does not understand character buffer dtype format string ('%c')", **ts);
25666  return number;
25667 }
25668 static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
25669  PyErr_Format(PyExc_ValueError,
25670  "Unexpected format string character: '%c'", ch);
25671 }
25672 static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
25673  switch (ch) {
25674  case '?': return "'bool'";
25675  case 'c': return "'char'";
25676  case 'b': return "'signed char'";
25677  case 'B': return "'unsigned char'";
25678  case 'h': return "'short'";
25679  case 'H': return "'unsigned short'";
25680  case 'i': return "'int'";
25681  case 'I': return "'unsigned int'";
25682  case 'l': return "'long'";
25683  case 'L': return "'unsigned long'";
25684  case 'q': return "'long long'";
25685  case 'Q': return "'unsigned long long'";
25686  case 'f': return (is_complex ? "'complex float'" : "'float'");
25687  case 'd': return (is_complex ? "'complex double'" : "'double'");
25688  case 'g': return (is_complex ? "'complex long double'" : "'long double'");
25689  case 'T': return "a struct";
25690  case 'O': return "Python object";
25691  case 'P': return "a pointer";
25692  case 's': case 'p': return "a string";
25693  case 0: return "end";
25694  default: return "unparseable format string";
25695  }
25696 }
25697 static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
25698  switch (ch) {
25699  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
25700  case 'h': case 'H': return 2;
25701  case 'i': case 'I': case 'l': case 'L': return 4;
25702  case 'q': case 'Q': return 8;
25703  case 'f': return (is_complex ? 8 : 4);
25704  case 'd': return (is_complex ? 16 : 8);
25705  case 'g': {
25706  PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
25707  return 0;
25708  }
25709  case 'O': case 'P': return sizeof(void*);
25710  default:
25711  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
25712  return 0;
25713  }
25714 }
25715 static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
25716  switch (ch) {
25717  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
25718  case 'h': case 'H': return sizeof(short);
25719  case 'i': case 'I': return sizeof(int);
25720  case 'l': case 'L': return sizeof(long);
25721  #ifdef HAVE_LONG_LONG
25722  case 'q': case 'Q': return sizeof(PY_LONG_LONG);
25723  #endif
25724  case 'f': return sizeof(float) * (is_complex ? 2 : 1);
25725  case 'd': return sizeof(double) * (is_complex ? 2 : 1);
25726  case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
25727  case 'O': case 'P': return sizeof(void*);
25728  default: {
25729  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
25730  return 0;
25731  }
25732  }
25733 }
25734 typedef struct { char c; short x; } __Pyx_st_short;
25735 typedef struct { char c; int x; } __Pyx_st_int;
25736 typedef struct { char c; long x; } __Pyx_st_long;
25737 typedef struct { char c; float x; } __Pyx_st_float;
25738 typedef struct { char c; double x; } __Pyx_st_double;
25739 typedef struct { char c; long double x; } __Pyx_st_longdouble;
25740 typedef struct { char c; void *x; } __Pyx_st_void_p;
25741 #ifdef HAVE_LONG_LONG
25742 typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
25743 #endif
25744 static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) {
25745  switch (ch) {
25746  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
25747  case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
25748  case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
25749  case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
25750 #ifdef HAVE_LONG_LONG
25751  case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
25752 #endif
25753  case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
25754  case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
25755  case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
25756  case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
25757  default:
25758  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
25759  return 0;
25760  }
25761 }
25762 /* These are for computing the padding at the end of the struct to align
25763  on the first member of the struct. This will probably the same as above,
25764  but we don't have any guarantees.
25765  */
25766 typedef struct { short x; char c; } __Pyx_pad_short;
25767 typedef struct { int x; char c; } __Pyx_pad_int;
25768 typedef struct { long x; char c; } __Pyx_pad_long;
25769 typedef struct { float x; char c; } __Pyx_pad_float;
25770 typedef struct { double x; char c; } __Pyx_pad_double;
25771 typedef struct { long double x; char c; } __Pyx_pad_longdouble;
25772 typedef struct { void *x; char c; } __Pyx_pad_void_p;
25773 #ifdef HAVE_LONG_LONG
25774 typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
25775 #endif
25776 static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) {
25777  switch (ch) {
25778  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
25779  case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
25780  case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
25781  case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
25782 #ifdef HAVE_LONG_LONG
25783  case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
25784 #endif
25785  case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
25786  case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
25787  case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
25788  case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
25789  default:
25790  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
25791  return 0;
25792  }
25793 }
25794 static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
25795  switch (ch) {
25796  case 'c':
25797  return 'H';
25798  case 'b': case 'h': case 'i':
25799  case 'l': case 'q': case 's': case 'p':
25800  return 'I';
25801  case '?': case 'B': case 'H': case 'I': case 'L': case 'Q':
25802  return 'U';
25803  case 'f': case 'd': case 'g':
25804  return (is_complex ? 'C' : 'R');
25805  case 'O':
25806  return 'O';
25807  case 'P':
25808  return 'P';
25809  default: {
25810  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
25811  return 0;
25812  }
25813  }
25814 }
25815 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
25816  if (ctx->head == NULL || ctx->head->field == &ctx->root) {
25817  const char* expected;
25818  const char* quote;
25819  if (ctx->head == NULL) {
25820  expected = "end";
25821  quote = "";
25822  } else {
25823  expected = ctx->head->field->type->name;
25824  quote = "'";
25825  }
25826  PyErr_Format(PyExc_ValueError,
25827  "Buffer dtype mismatch, expected %s%s%s but got %s",
25828  quote, expected, quote,
25829  __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
25830  } else {
25831  __Pyx_StructField* field = ctx->head->field;
25832  __Pyx_StructField* parent = (ctx->head - 1)->field;
25833  PyErr_Format(PyExc_ValueError,
25834  "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
25835  field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
25836  parent->type->name, field->name);
25837  }
25838 }
25839 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
25840  char group;
25841  size_t size, offset, arraysize = 1;
25842  if (ctx->enc_type == 0) return 0;
25843  if (ctx->head->field->type->arraysize[0]) {
25844  int i, ndim = 0;
25845  if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
25846  ctx->is_valid_array = ctx->head->field->type->ndim == 1;
25847  ndim = 1;
25848  if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
25849  PyErr_Format(PyExc_ValueError,
25850  "Expected a dimension of size %zu, got %zu",
25851  ctx->head->field->type->arraysize[0], ctx->enc_count);
25852  return -1;
25853  }
25854  }
25855  if (!ctx->is_valid_array) {
25856  PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
25857  ctx->head->field->type->ndim, ndim);
25858  return -1;
25859  }
25860  for (i = 0; i < ctx->head->field->type->ndim; i++) {
25861  arraysize *= ctx->head->field->type->arraysize[i];
25862  }
25863  ctx->is_valid_array = 0;
25864  ctx->enc_count = 1;
25865  }
25866  group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
25867  do {
25868  __Pyx_StructField* field = ctx->head->field;
25869  __Pyx_TypeInfo* type = field->type;
25870  if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
25871  size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
25872  } else {
25873  size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
25874  }
25875  if (ctx->enc_packmode == '@') {
25876  size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
25877  size_t align_mod_offset;
25878  if (align_at == 0) return -1;
25879  align_mod_offset = ctx->fmt_offset % align_at;
25880  if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
25881  if (ctx->struct_alignment == 0)
25882  ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
25883  ctx->is_complex);
25884  }
25885  if (type->size != size || type->typegroup != group) {
25886  if (type->typegroup == 'C' && type->fields != NULL) {
25887  size_t parent_offset = ctx->head->parent_offset + field->offset;
25888  ++ctx->head;
25889  ctx->head->field = type->fields;
25890  ctx->head->parent_offset = parent_offset;
25891  continue;
25892  }
25893  if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
25894  } else {
25895  __Pyx_BufFmt_RaiseExpected(ctx);
25896  return -1;
25897  }
25898  }
25899  offset = ctx->head->parent_offset + field->offset;
25900  if (ctx->fmt_offset != offset) {
25901  PyErr_Format(PyExc_ValueError,
25902  "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
25903  (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
25904  return -1;
25905  }
25906  ctx->fmt_offset += size;
25907  if (arraysize)
25908  ctx->fmt_offset += (arraysize - 1) * size;
25909  --ctx->enc_count;
25910  while (1) {
25911  if (field == &ctx->root) {
25912  ctx->head = NULL;
25913  if (ctx->enc_count != 0) {
25914  __Pyx_BufFmt_RaiseExpected(ctx);
25915  return -1;
25916  }
25917  break;
25918  }
25919  ctx->head->field = ++field;
25920  if (field->type == NULL) {
25921  --ctx->head;
25922  field = ctx->head->field;
25923  continue;
25924  } else if (field->type->typegroup == 'S') {
25925  size_t parent_offset = ctx->head->parent_offset + field->offset;
25926  if (field->type->fields->type == NULL) continue;
25927  field = field->type->fields;
25928  ++ctx->head;
25929  ctx->head->field = field;
25930  ctx->head->parent_offset = parent_offset;
25931  break;
25932  } else {
25933  break;
25934  }
25935  }
25936  } while (ctx->enc_count);
25937  ctx->enc_type = 0;
25938  ctx->is_complex = 0;
25939  return 0;
25940 }
25941 static PyObject *
25942 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
25943 {
25944  const char *ts = *tsp;
25945  int i = 0, number, ndim;
25946  ++ts;
25947  if (ctx->new_count != 1) {
25948  PyErr_SetString(PyExc_ValueError,
25949  "Cannot handle repeated arrays in format string");
25950  return NULL;
25951  }
25952  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
25953  ndim = ctx->head->field->type->ndim;
25954  while (*ts && *ts != ')') {
25955  switch (*ts) {
25956  case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue;
25957  default: break;
25958  }
25959  number = __Pyx_BufFmt_ExpectNumber(&ts);
25960  if (number == -1) return NULL;
25961  if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
25962  return PyErr_Format(PyExc_ValueError,
25963  "Expected a dimension of size %zu, got %d",
25964  ctx->head->field->type->arraysize[i], number);
25965  if (*ts != ',' && *ts != ')')
25966  return PyErr_Format(PyExc_ValueError,
25967  "Expected a comma in format string, got '%c'", *ts);
25968  if (*ts == ',') ts++;
25969  i++;
25970  }
25971  if (i != ndim)
25972  return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
25973  ctx->head->field->type->ndim, i);
25974  if (!*ts) {
25975  PyErr_SetString(PyExc_ValueError,
25976  "Unexpected end of format string, expected ')'");
25977  return NULL;
25978  }
25979  ctx->is_valid_array = 1;
25980  ctx->new_count = 1;
25981  *tsp = ++ts;
25982  return Py_None;
25983 }
25984 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
25985  int got_Z = 0;
25986  while (1) {
25987  switch(*ts) {
25988  case 0:
25989  if (ctx->enc_type != 0 && ctx->head == NULL) {
25990  __Pyx_BufFmt_RaiseExpected(ctx);
25991  return NULL;
25992  }
25993  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
25994  if (ctx->head != NULL) {
25995  __Pyx_BufFmt_RaiseExpected(ctx);
25996  return NULL;
25997  }
25998  return ts;
25999  case ' ':
26000  case '\r':
26001  case '\n':
26002  ++ts;
26003  break;
26004  case '<':
26005  if (!__Pyx_Is_Little_Endian()) {
26006  PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
26007  return NULL;
26008  }
26009  ctx->new_packmode = '=';
26010  ++ts;
26011  break;
26012  case '>':
26013  case '!':
26014  if (__Pyx_Is_Little_Endian()) {
26015  PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
26016  return NULL;
26017  }
26018  ctx->new_packmode = '=';
26019  ++ts;
26020  break;
26021  case '=':
26022  case '@':
26023  case '^':
26024  ctx->new_packmode = *ts++;
26025  break;
26026  case 'T':
26027  {
26028  const char* ts_after_sub;
26029  size_t i, struct_count = ctx->new_count;
26030  size_t struct_alignment = ctx->struct_alignment;
26031  ctx->new_count = 1;
26032  ++ts;
26033  if (*ts != '{') {
26034  PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
26035  return NULL;
26036  }
26037  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
26038  ctx->enc_type = 0;
26039  ctx->enc_count = 0;
26040  ctx->struct_alignment = 0;
26041  ++ts;
26042  ts_after_sub = ts;
26043  for (i = 0; i != struct_count; ++i) {
26044  ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
26045  if (!ts_after_sub) return NULL;
26046  }
26047  ts = ts_after_sub;
26048  if (struct_alignment) ctx->struct_alignment = struct_alignment;
26049  }
26050  break;
26051  case '}':
26052  {
26053  size_t alignment = ctx->struct_alignment;
26054  ++ts;
26055  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
26056  ctx->enc_type = 0;
26057  if (alignment && ctx->fmt_offset % alignment) {
26058  ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
26059  }
26060  }
26061  return ts;
26062  case 'x':
26063  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
26064  ctx->fmt_offset += ctx->new_count;
26065  ctx->new_count = 1;
26066  ctx->enc_count = 0;
26067  ctx->enc_type = 0;
26068  ctx->enc_packmode = ctx->new_packmode;
26069  ++ts;
26070  break;
26071  case 'Z':
26072  got_Z = 1;
26073  ++ts;
26074  if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
26075  __Pyx_BufFmt_RaiseUnexpectedChar('Z');
26076  return NULL;
26077  }
26078  CYTHON_FALLTHROUGH;
26079  case '?': case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
26080  case 'l': case 'L': case 'q': case 'Q':
26081  case 'f': case 'd': case 'g':
26082  case 'O': case 'p':
26083  if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) &&
26084  (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) {
26085  ctx->enc_count += ctx->new_count;
26086  ctx->new_count = 1;
26087  got_Z = 0;
26088  ++ts;
26089  break;
26090  }
26091  CYTHON_FALLTHROUGH;
26092  case 's':
26093  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
26094  ctx->enc_count = ctx->new_count;
26095  ctx->enc_packmode = ctx->new_packmode;
26096  ctx->enc_type = *ts;
26097  ctx->is_complex = got_Z;
26098  ++ts;
26099  ctx->new_count = 1;
26100  got_Z = 0;
26101  break;
26102  case ':':
26103  ++ts;
26104  while(*ts != ':') ++ts;
26105  ++ts;
26106  break;
26107  case '(':
26108  if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL;
26109  break;
26110  default:
26111  {
26112  int number = __Pyx_BufFmt_ExpectNumber(&ts);
26113  if (number == -1) return NULL;
26114  ctx->new_count = (size_t)number;
26115  }
26116  }
26117  }
26118 }
26119 
26120 /* TypeInfoCompare */
26121  static int
26122 __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
26123 {
26124  int i;
26125  if (!a || !b)
26126  return 0;
26127  if (a == b)
26128  return 1;
26129  if (a->size != b->size || a->typegroup != b->typegroup ||
26130  a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
26131  if (a->typegroup == 'H' || b->typegroup == 'H') {
26132  return a->size == b->size;
26133  } else {
26134  return 0;
26135  }
26136  }
26137  if (a->ndim) {
26138  for (i = 0; i < a->ndim; i++)
26139  if (a->arraysize[i] != b->arraysize[i])
26140  return 0;
26141  }
26142  if (a->typegroup == 'S') {
26143  if (a->flags != b->flags)
26144  return 0;
26145  if (a->fields || b->fields) {
26146  if (!(a->fields && b->fields))
26147  return 0;
26148  for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
26149  __Pyx_StructField *field_a = a->fields + i;
26150  __Pyx_StructField *field_b = b->fields + i;
26151  if (field_a->offset != field_b->offset ||
26152  !__pyx_typeinfo_cmp(field_a->type, field_b->type))
26153  return 0;
26154  }
26155  return !a->fields[i].type && !b->fields[i].type;
26156  }
26157  }
26158  return 1;
26159 }
26160 
26161 /* MemviewSliceValidateAndInit */
26162  static int
26163 __pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec)
26164 {
26165  if (buf->shape[dim] <= 1)
26166  return 1;
26167  if (buf->strides) {
26168  if (spec & __Pyx_MEMVIEW_CONTIG) {
26169  if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
26170  if (unlikely(buf->strides[dim] != sizeof(void *))) {
26171  PyErr_Format(PyExc_ValueError,
26172  "Buffer is not indirectly contiguous "
26173  "in dimension %d.", dim);
26174  goto fail;
26175  }
26176  } else if (unlikely(buf->strides[dim] != buf->itemsize)) {
26177  PyErr_SetString(PyExc_ValueError,
26178  "Buffer and memoryview are not contiguous "
26179  "in the same dimension.");
26180  goto fail;
26181  }
26182  }
26183  if (spec & __Pyx_MEMVIEW_FOLLOW) {
26184  Py_ssize_t stride = buf->strides[dim];
26185  if (stride < 0)
26186  stride = -stride;
26187  if (unlikely(stride < buf->itemsize)) {
26188  PyErr_SetString(PyExc_ValueError,
26189  "Buffer and memoryview are not contiguous "
26190  "in the same dimension.");
26191  goto fail;
26192  }
26193  }
26194  } else {
26195  if (unlikely(spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1)) {
26196  PyErr_Format(PyExc_ValueError,
26197  "C-contiguous buffer is not contiguous in "
26198  "dimension %d", dim);
26199  goto fail;
26200  } else if (unlikely(spec & (__Pyx_MEMVIEW_PTR))) {
26201  PyErr_Format(PyExc_ValueError,
26202  "C-contiguous buffer is not indirect in "
26203  "dimension %d", dim);
26204  goto fail;
26205  } else if (unlikely(buf->suboffsets)) {
26206  PyErr_SetString(PyExc_ValueError,
26207  "Buffer exposes suboffsets but no strides");
26208  goto fail;
26209  }
26210  }
26211  return 1;
26212 fail:
26213  return 0;
26214 }
26215 static int
26216 __pyx_check_suboffsets(Py_buffer *buf, int dim, CYTHON_UNUSED int ndim, int spec)
26217 {
26218  if (spec & __Pyx_MEMVIEW_DIRECT) {
26219  if (unlikely(buf->suboffsets && buf->suboffsets[dim] >= 0)) {
26220  PyErr_Format(PyExc_ValueError,
26221  "Buffer not compatible with direct access "
26222  "in dimension %d.", dim);
26223  goto fail;
26224  }
26225  }
26226  if (spec & __Pyx_MEMVIEW_PTR) {
26227  if (unlikely(!buf->suboffsets || (buf->suboffsets[dim] < 0))) {
26228  PyErr_Format(PyExc_ValueError,
26229  "Buffer is not indirectly accessible "
26230  "in dimension %d.", dim);
26231  goto fail;
26232  }
26233  }
26234  return 1;
26235 fail:
26236  return 0;
26237 }
26238 static int
26239 __pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag)
26240 {
26241  int i;
26242  if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
26243  Py_ssize_t stride = 1;
26244  for (i = 0; i < ndim; i++) {
26245  if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
26246  PyErr_SetString(PyExc_ValueError,
26247  "Buffer not fortran contiguous.");
26248  goto fail;
26249  }
26250  stride = stride * buf->shape[i];
26251  }
26252  } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
26253  Py_ssize_t stride = 1;
26254  for (i = ndim - 1; i >- 1; i--) {
26255  if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
26256  PyErr_SetString(PyExc_ValueError,
26257  "Buffer not C contiguous.");
26258  goto fail;
26259  }
26260  stride = stride * buf->shape[i];
26261  }
26262  }
26263  return 1;
26264 fail:
26265  return 0;
26266 }
26267 static int __Pyx_ValidateAndInit_memviewslice(
26268  int *axes_specs,
26269  int c_or_f_flag,
26270  int buf_flags,
26271  int ndim,
26272  __Pyx_TypeInfo *dtype,
26273  __Pyx_BufFmt_StackElem stack[],
26274  __Pyx_memviewslice *memviewslice,
26275  PyObject *original_obj)
26276 {
26277  struct __pyx_memoryview_obj *memview, *new_memview;
26278  __Pyx_RefNannyDeclarations
26279  Py_buffer *buf;
26280  int i, spec = 0, retval = -1;
26281  __Pyx_BufFmt_Context ctx;
26282  int from_memoryview = __pyx_memoryview_check(original_obj);
26283  __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0);
26284  if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *)
26285  original_obj)->typeinfo)) {
26286  memview = (struct __pyx_memoryview_obj *) original_obj;
26287  new_memview = NULL;
26288  } else {
26289  memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
26290  original_obj, buf_flags, 0, dtype);
26291  new_memview = memview;
26292  if (unlikely(!memview))
26293  goto fail;
26294  }
26295  buf = &memview->view;
26296  if (unlikely(buf->ndim != ndim)) {
26297  PyErr_Format(PyExc_ValueError,
26298  "Buffer has wrong number of dimensions (expected %d, got %d)",
26299  ndim, buf->ndim);
26300  goto fail;
26301  }
26302  if (new_memview) {
26303  __Pyx_BufFmt_Init(&ctx, stack, dtype);
26304  if (unlikely(!__Pyx_BufFmt_CheckString(&ctx, buf->format))) goto fail;
26305  }
26306  if (unlikely((unsigned) buf->itemsize != dtype->size)) {
26307  PyErr_Format(PyExc_ValueError,
26308  "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) "
26309  "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)",
26310  buf->itemsize,
26311  (buf->itemsize > 1) ? "s" : "",
26312  dtype->name,
26313  dtype->size,
26314  (dtype->size > 1) ? "s" : "");
26315  goto fail;
26316  }
26317  if (buf->len > 0) {
26318  for (i = 0; i < ndim; i++) {
26319  spec = axes_specs[i];
26320  if (unlikely(!__pyx_check_strides(buf, i, ndim, spec)))
26321  goto fail;
26322  if (unlikely(!__pyx_check_suboffsets(buf, i, ndim, spec)))
26323  goto fail;
26324  }
26325  if (unlikely(buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag)))
26326  goto fail;
26327  }
26328  if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
26329  new_memview != NULL) == -1)) {
26330  goto fail;
26331  }
26332  retval = 0;
26333  goto no_fail;
26334 fail:
26335  Py_XDECREF(new_memview);
26336  retval = -1;
26337 no_fail:
26338  __Pyx_RefNannyFinishContext();
26339  return retval;
26340 }
26341 
26342 /* ObjectToMemviewSlice */
26343  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_float(PyObject *obj, int writable_flag) {
26344  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
26345  __Pyx_BufFmt_StackElem stack[1];
26346  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
26347  int retcode;
26348  if (obj == Py_None) {
26349  result.memview = (struct __pyx_memoryview_obj *) Py_None;
26350  return result;
26351  }
26352  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
26353  PyBUF_RECORDS_RO | writable_flag, 1,
26354  &__Pyx_TypeInfo_float, stack,
26355  &result, obj);
26356  if (unlikely(retcode == -1))
26357  goto __pyx_fail;
26358  return result;
26359 __pyx_fail:
26360  result.memview = NULL;
26361  result.data = NULL;
26362  return result;
26363 }
26364 
26365 /* ObjectToMemviewSlice */
26366  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_float(PyObject *obj, int writable_flag) {
26367  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
26368  __Pyx_BufFmt_StackElem stack[1];
26369  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
26370  int retcode;
26371  if (obj == Py_None) {
26372  result.memview = (struct __pyx_memoryview_obj *) Py_None;
26373  return result;
26374  }
26375  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
26376  (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
26377  &__Pyx_TypeInfo_float, stack,
26378  &result, obj);
26379  if (unlikely(retcode == -1))
26380  goto __pyx_fail;
26381  return result;
26382 __pyx_fail:
26383  result.memview = NULL;
26384  result.data = NULL;
26385  return result;
26386 }
26387 
26388 /* ObjectToMemviewSlice */
26389  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject *obj, int writable_flag) {
26390  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
26391  __Pyx_BufFmt_StackElem stack[1];
26392  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
26393  int retcode;
26394  if (obj == Py_None) {
26395  result.memview = (struct __pyx_memoryview_obj *) Py_None;
26396  return result;
26397  }
26398  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
26399  PyBUF_RECORDS_RO | writable_flag, 1,
26400  &__Pyx_TypeInfo_int, stack,
26401  &result, obj);
26402  if (unlikely(retcode == -1))
26403  goto __pyx_fail;
26404  return result;
26405 __pyx_fail:
26406  result.memview = NULL;
26407  result.data = NULL;
26408  return result;
26409 }
26410 
26411 /* ObjectToMemviewSlice */
26412  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *obj, int writable_flag) {
26413  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
26414  __Pyx_BufFmt_StackElem stack[1];
26415  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
26416  int retcode;
26417  if (obj == Py_None) {
26418  result.memview = (struct __pyx_memoryview_obj *) Py_None;
26419  return result;
26420  }
26421  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
26422  PyBUF_RECORDS_RO | writable_flag, 1,
26423  &__Pyx_TypeInfo_double, stack,
26424  &result, obj);
26425  if (unlikely(retcode == -1))
26426  goto __pyx_fail;
26427  return result;
26428 __pyx_fail:
26429  result.memview = NULL;
26430  result.data = NULL;
26431  return result;
26432 }
26433 
26434 /* ObjectToMemviewSlice */
26435  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(PyObject *obj, int writable_flag) {
26436  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
26437  __Pyx_BufFmt_StackElem stack[1];
26438  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
26439  int retcode;
26440  if (obj == Py_None) {
26441  result.memview = (struct __pyx_memoryview_obj *) Py_None;
26442  return result;
26443  }
26444  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
26445  (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
26446  &__Pyx_TypeInfo_double, stack,
26447  &result, obj);
26448  if (unlikely(retcode == -1))
26449  goto __pyx_fail;
26450  return result;
26451 __pyx_fail:
26452  result.memview = NULL;
26453  result.data = NULL;
26454  return result;
26455 }
26456 
26457 /* ObjectToMemviewSlice */
26458  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(PyObject *obj, int writable_flag) {
26459  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
26460  __Pyx_BufFmt_StackElem stack[1];
26461  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
26462  int retcode;
26463  if (obj == Py_None) {
26464  result.memview = (struct __pyx_memoryview_obj *) Py_None;
26465  return result;
26466  }
26467  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
26468  PyBUF_RECORDS_RO | writable_flag, 1,
26469  &__Pyx_TypeInfo_long__double, stack,
26470  &result, obj);
26471  if (unlikely(retcode == -1))
26472  goto __pyx_fail;
26473  return result;
26474 __pyx_fail:
26475  result.memview = NULL;
26476  result.data = NULL;
26477  return result;
26478 }
26479 
26480 /* ObjectToMemviewSlice */
26481  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_long__double(PyObject *obj, int writable_flag) {
26482  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
26483  __Pyx_BufFmt_StackElem stack[1];
26484  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
26485  int retcode;
26486  if (obj == Py_None) {
26487  result.memview = (struct __pyx_memoryview_obj *) Py_None;
26488  return result;
26489  }
26490  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
26491  (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
26492  &__Pyx_TypeInfo_long__double, stack,
26493  &result, obj);
26494  if (unlikely(retcode == -1))
26495  goto __pyx_fail;
26496  return result;
26497 __pyx_fail:
26498  result.memview = NULL;
26499  result.data = NULL;
26500  return result;
26501 }
26502 
26503 /* Declarations */
26504  #if CYTHON_CCOMPLEX
26505  #ifdef __cplusplus
26506  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
26507  return ::std::complex< float >(x, y);
26508  }
26509  #else
26510  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
26511  return x + y*(__pyx_t_float_complex)_Complex_I;
26512  }
26513  #endif
26514 #else
26515  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
26516  __pyx_t_float_complex z;
26517  z.real = x;
26518  z.imag = y;
26519  return z;
26520  }
26521 #endif
26522 
26523 /* Arithmetic */
26524  #if CYTHON_CCOMPLEX
26525 #else
26526  static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
26527  return (a.real == b.real) && (a.imag == b.imag);
26528  }
26529  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
26530  __pyx_t_float_complex z;
26531  z.real = a.real + b.real;
26532  z.imag = a.imag + b.imag;
26533  return z;
26534  }
26535  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
26536  __pyx_t_float_complex z;
26537  z.real = a.real - b.real;
26538  z.imag = a.imag - b.imag;
26539  return z;
26540  }
26541  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
26542  __pyx_t_float_complex z;
26543  z.real = a.real * b.real - a.imag * b.imag;
26544  z.imag = a.real * b.imag + a.imag * b.real;
26545  return z;
26546  }
26547  #if 1
26548  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
26549  if (b.imag == 0) {
26550  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
26551  } else if (fabsf(b.real) >= fabsf(b.imag)) {
26552  if (b.real == 0 && b.imag == 0) {
26553  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
26554  } else {
26555  float r = b.imag / b.real;
26556  float s = (float)(1.0) / (b.real + b.imag * r);
26557  return __pyx_t_float_complex_from_parts(
26558  (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
26559  }
26560  } else {
26561  float r = b.real / b.imag;
26562  float s = (float)(1.0) / (b.imag + b.real * r);
26563  return __pyx_t_float_complex_from_parts(
26564  (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
26565  }
26566  }
26567  #else
26568  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
26569  if (b.imag == 0) {
26570  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
26571  } else {
26572  float denom = b.real * b.real + b.imag * b.imag;
26573  return __pyx_t_float_complex_from_parts(
26574  (a.real * b.real + a.imag * b.imag) / denom,
26575  (a.imag * b.real - a.real * b.imag) / denom);
26576  }
26577  }
26578  #endif
26579  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
26580  __pyx_t_float_complex z;
26581  z.real = -a.real;
26582  z.imag = -a.imag;
26583  return z;
26584  }
26585  static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
26586  return (a.real == 0) && (a.imag == 0);
26587  }
26588  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
26589  __pyx_t_float_complex z;
26590  z.real = a.real;
26591  z.imag = -a.imag;
26592  return z;
26593  }
26594  #if 1
26595  static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
26596  #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
26597  return sqrtf(z.real*z.real + z.imag*z.imag);
26598  #else
26599  return hypotf(z.real, z.imag);
26600  #endif
26601  }
26602  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
26603  __pyx_t_float_complex z;
26604  float r, lnr, theta, z_r, z_theta;
26605  if (b.imag == 0 && b.real == (int)b.real) {
26606  if (b.real < 0) {
26607  float denom = a.real * a.real + a.imag * a.imag;
26608  a.real = a.real / denom;
26609  a.imag = -a.imag / denom;
26610  b.real = -b.real;
26611  }
26612  switch ((int)b.real) {
26613  case 0:
26614  z.real = 1;
26615  z.imag = 0;
26616  return z;
26617  case 1:
26618  return a;
26619  case 2:
26620  return __Pyx_c_prod_float(a, a);
26621  case 3:
26622  z = __Pyx_c_prod_float(a, a);
26623  return __Pyx_c_prod_float(z, a);
26624  case 4:
26625  z = __Pyx_c_prod_float(a, a);
26626  return __Pyx_c_prod_float(z, z);
26627  }
26628  }
26629  if (a.imag == 0) {
26630  if (a.real == 0) {
26631  return a;
26632  } else if ((b.imag == 0) && (a.real >= 0)) {
26633  z.real = powf(a.real, b.real);
26634  z.imag = 0;
26635  return z;
26636  } else if (a.real > 0) {
26637  r = a.real;
26638  theta = 0;
26639  } else {
26640  r = -a.real;
26641  theta = atan2f(0.0, -1.0);
26642  }
26643  } else {
26644  r = __Pyx_c_abs_float(a);
26645  theta = atan2f(a.imag, a.real);
26646  }
26647  lnr = logf(r);
26648  z_r = expf(lnr * b.real - theta * b.imag);
26649  z_theta = theta * b.real + lnr * b.imag;
26650  z.real = z_r * cosf(z_theta);
26651  z.imag = z_r * sinf(z_theta);
26652  return z;
26653  }
26654  #endif
26655 #endif
26656 
26657 /* Declarations */
26658  #if CYTHON_CCOMPLEX
26659  #ifdef __cplusplus
26660  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
26661  return ::std::complex< double >(x, y);
26662  }
26663  #else
26664  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
26665  return x + y*(__pyx_t_double_complex)_Complex_I;
26666  }
26667  #endif
26668 #else
26669  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
26670  __pyx_t_double_complex z;
26671  z.real = x;
26672  z.imag = y;
26673  return z;
26674  }
26675 #endif
26676 
26677 /* Arithmetic */
26678  #if CYTHON_CCOMPLEX
26679 #else
26680  static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26681  return (a.real == b.real) && (a.imag == b.imag);
26682  }
26683  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26684  __pyx_t_double_complex z;
26685  z.real = a.real + b.real;
26686  z.imag = a.imag + b.imag;
26687  return z;
26688  }
26689  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26690  __pyx_t_double_complex z;
26691  z.real = a.real - b.real;
26692  z.imag = a.imag - b.imag;
26693  return z;
26694  }
26695  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26696  __pyx_t_double_complex z;
26697  z.real = a.real * b.real - a.imag * b.imag;
26698  z.imag = a.real * b.imag + a.imag * b.real;
26699  return z;
26700  }
26701  #if 1
26702  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26703  if (b.imag == 0) {
26704  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
26705  } else if (fabs(b.real) >= fabs(b.imag)) {
26706  if (b.real == 0 && b.imag == 0) {
26707  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
26708  } else {
26709  double r = b.imag / b.real;
26710  double s = (double)(1.0) / (b.real + b.imag * r);
26711  return __pyx_t_double_complex_from_parts(
26712  (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
26713  }
26714  } else {
26715  double r = b.real / b.imag;
26716  double s = (double)(1.0) / (b.imag + b.real * r);
26717  return __pyx_t_double_complex_from_parts(
26718  (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
26719  }
26720  }
26721  #else
26722  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26723  if (b.imag == 0) {
26724  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
26725  } else {
26726  double denom = b.real * b.real + b.imag * b.imag;
26727  return __pyx_t_double_complex_from_parts(
26728  (a.real * b.real + a.imag * b.imag) / denom,
26729  (a.imag * b.real - a.real * b.imag) / denom);
26730  }
26731  }
26732  #endif
26733  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
26734  __pyx_t_double_complex z;
26735  z.real = -a.real;
26736  z.imag = -a.imag;
26737  return z;
26738  }
26739  static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
26740  return (a.real == 0) && (a.imag == 0);
26741  }
26742  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
26743  __pyx_t_double_complex z;
26744  z.real = a.real;
26745  z.imag = -a.imag;
26746  return z;
26747  }
26748  #if 1
26749  static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
26750  #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
26751  return sqrt(z.real*z.real + z.imag*z.imag);
26752  #else
26753  return hypot(z.real, z.imag);
26754  #endif
26755  }
26756  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26757  __pyx_t_double_complex z;
26758  double r, lnr, theta, z_r, z_theta;
26759  if (b.imag == 0 && b.real == (int)b.real) {
26760  if (b.real < 0) {
26761  double denom = a.real * a.real + a.imag * a.imag;
26762  a.real = a.real / denom;
26763  a.imag = -a.imag / denom;
26764  b.real = -b.real;
26765  }
26766  switch ((int)b.real) {
26767  case 0:
26768  z.real = 1;
26769  z.imag = 0;
26770  return z;
26771  case 1:
26772  return a;
26773  case 2:
26774  return __Pyx_c_prod_double(a, a);
26775  case 3:
26776  z = __Pyx_c_prod_double(a, a);
26777  return __Pyx_c_prod_double(z, a);
26778  case 4:
26779  z = __Pyx_c_prod_double(a, a);
26780  return __Pyx_c_prod_double(z, z);
26781  }
26782  }
26783  if (a.imag == 0) {
26784  if (a.real == 0) {
26785  return a;
26786  } else if ((b.imag == 0) && (a.real >= 0)) {
26787  z.real = pow(a.real, b.real);
26788  z.imag = 0;
26789  return z;
26790  } else if (a.real > 0) {
26791  r = a.real;
26792  theta = 0;
26793  } else {
26794  r = -a.real;
26795  theta = atan2(0.0, -1.0);
26796  }
26797  } else {
26798  r = __Pyx_c_abs_double(a);
26799  theta = atan2(a.imag, a.real);
26800  }
26801  lnr = log(r);
26802  z_r = exp(lnr * b.real - theta * b.imag);
26803  z_theta = theta * b.real + lnr * b.imag;
26804  z.real = z_r * cos(z_theta);
26805  z.imag = z_r * sin(z_theta);
26806  return z;
26807  }
26808  #endif
26809 #endif
26810 
26811 /* MemviewSliceCopyTemplate */
26812  static __Pyx_memviewslice
26813 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
26814  const char *mode, int ndim,
26815  size_t sizeof_dtype, int contig_flag,
26816  int dtype_is_object)
26817 {
26818  __Pyx_RefNannyDeclarations
26819  int i;
26820  __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
26821  struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
26822  Py_buffer *buf = &from_memview->view;
26823  PyObject *shape_tuple = NULL;
26824  PyObject *temp_int = NULL;
26825  struct __pyx_array_obj *array_obj = NULL;
26826  struct __pyx_memoryview_obj *memview_obj = NULL;
26827  __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0);
26828  for (i = 0; i < ndim; i++) {
26829  if (unlikely(from_mvs->suboffsets[i] >= 0)) {
26830  PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with "
26831  "indirect dimensions (axis %d)", i);
26832  goto fail;
26833  }
26834  }
26835  shape_tuple = PyTuple_New(ndim);
26836  if (unlikely(!shape_tuple)) {
26837  goto fail;
26838  }
26839  __Pyx_GOTREF(shape_tuple);
26840  for(i = 0; i < ndim; i++) {
26841  temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
26842  if(unlikely(!temp_int)) {
26843  goto fail;
26844  } else {
26845  PyTuple_SET_ITEM(shape_tuple, i, temp_int);
26846  temp_int = NULL;
26847  }
26848  }
26849  array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL);
26850  if (unlikely(!array_obj)) {
26851  goto fail;
26852  }
26853  __Pyx_GOTREF(array_obj);
26854  memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
26855  (PyObject *) array_obj, contig_flag,
26856  dtype_is_object,
26857  from_mvs->memview->typeinfo);
26858  if (unlikely(!memview_obj))
26859  goto fail;
26860  if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
26861  goto fail;
26862  if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
26863  dtype_is_object) < 0))
26864  goto fail;
26865  goto no_fail;
26866 fail:
26867  __Pyx_XDECREF(new_mvs.memview);
26868  new_mvs.memview = NULL;
26869  new_mvs.data = NULL;
26870 no_fail:
26871  __Pyx_XDECREF(shape_tuple);
26872  __Pyx_XDECREF(temp_int);
26873  __Pyx_XDECREF(array_obj);
26874  __Pyx_RefNannyFinishContext();
26875  return new_mvs;
26876 }
26877 
26878 /* CIntFromPy */
26879  static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
26880 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
26881 #pragma GCC diagnostic push
26882 #pragma GCC diagnostic ignored "-Wconversion"
26883 #endif
26884  const int neg_one = (int) -1, const_zero = (int) 0;
26885 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
26886 #pragma GCC diagnostic pop
26887 #endif
26888  const int is_unsigned = neg_one > const_zero;
26889 #if PY_MAJOR_VERSION < 3
26890  if (likely(PyInt_Check(x))) {
26891  if (sizeof(int) < sizeof(long)) {
26892  __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
26893  } else {
26894  long val = PyInt_AS_LONG(x);
26895  if (is_unsigned && unlikely(val < 0)) {
26896  goto raise_neg_overflow;
26897  }
26898  return (int) val;
26899  }
26900  } else
26901 #endif
26902  if (likely(PyLong_Check(x))) {
26903  if (is_unsigned) {
26904 #if CYTHON_USE_PYLONG_INTERNALS
26905  const digit* digits = ((PyLongObject*)x)->ob_digit;
26906  switch (Py_SIZE(x)) {
26907  case 0: return (int) 0;
26908  case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
26909  case 2:
26910  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
26911  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
26912  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26913  } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
26914  return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
26915  }
26916  }
26917  break;
26918  case 3:
26919  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
26920  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
26921  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26922  } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
26923  return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
26924  }
26925  }
26926  break;
26927  case 4:
26928  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
26929  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
26930  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26931  } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
26932  return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
26933  }
26934  }
26935  break;
26936  }
26937 #endif
26938 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
26939  if (unlikely(Py_SIZE(x) < 0)) {
26940  goto raise_neg_overflow;
26941  }
26942 #else
26943  {
26944  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
26945  if (unlikely(result < 0))
26946  return (int) -1;
26947  if (unlikely(result == 1))
26948  goto raise_neg_overflow;
26949  }
26950 #endif
26951  if (sizeof(int) <= sizeof(unsigned long)) {
26952  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
26953 #ifdef HAVE_LONG_LONG
26954  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
26955  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
26956 #endif
26957  }
26958  } else {
26959 #if CYTHON_USE_PYLONG_INTERNALS
26960  const digit* digits = ((PyLongObject*)x)->ob_digit;
26961  switch (Py_SIZE(x)) {
26962  case 0: return (int) 0;
26963  case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
26964  case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
26965  case -2:
26966  if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
26967  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
26968  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26969  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
26970  return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
26971  }
26972  }
26973  break;
26974  case 2:
26975  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
26976  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
26977  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26978  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
26979  return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
26980  }
26981  }
26982  break;
26983  case -3:
26984  if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
26985  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
26986  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26987  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
26988  return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
26989  }
26990  }
26991  break;
26992  case 3:
26993  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
26994  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
26995  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26996  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
26997  return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
26998  }
26999  }
27000  break;
27001  case -4:
27002  if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
27003  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27004  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27005  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
27006  return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
27007  }
27008  }
27009  break;
27010  case 4:
27011  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
27012  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27013  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27014  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
27015  return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
27016  }
27017  }
27018  break;
27019  }
27020 #endif
27021  if (sizeof(int) <= sizeof(long)) {
27022  __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
27023 #ifdef HAVE_LONG_LONG
27024  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
27025  __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
27026 #endif
27027  }
27028  }
27029  {
27030 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
27031  PyErr_SetString(PyExc_RuntimeError,
27032  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
27033 #else
27034  int val;
27035  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
27036  #if PY_MAJOR_VERSION < 3
27037  if (likely(v) && !PyLong_Check(v)) {
27038  PyObject *tmp = v;
27039  v = PyNumber_Long(tmp);
27040  Py_DECREF(tmp);
27041  }
27042  #endif
27043  if (likely(v)) {
27044  int one = 1; int is_little = (int)*(unsigned char *)&one;
27045  unsigned char *bytes = (unsigned char *)&val;
27046  int ret = _PyLong_AsByteArray((PyLongObject *)v,
27047  bytes, sizeof(val),
27048  is_little, !is_unsigned);
27049  Py_DECREF(v);
27050  if (likely(!ret))
27051  return val;
27052  }
27053 #endif
27054  return (int) -1;
27055  }
27056  } else {
27057  int val;
27058  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
27059  if (!tmp) return (int) -1;
27060  val = __Pyx_PyInt_As_int(tmp);
27061  Py_DECREF(tmp);
27062  return val;
27063  }
27064 raise_overflow:
27065  PyErr_SetString(PyExc_OverflowError,
27066  "value too large to convert to int");
27067  return (int) -1;
27068 raise_neg_overflow:
27069  PyErr_SetString(PyExc_OverflowError,
27070  "can't convert negative value to int");
27071  return (int) -1;
27072 }
27073 
27074 /* CIntFromPy */
27075  static CYTHON_INLINE int64_t __Pyx_PyInt_As_int64_t(PyObject *x) {
27076 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27077 #pragma GCC diagnostic push
27078 #pragma GCC diagnostic ignored "-Wconversion"
27079 #endif
27080  const int64_t neg_one = (int64_t) -1, const_zero = (int64_t) 0;
27081 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27082 #pragma GCC diagnostic pop
27083 #endif
27084  const int is_unsigned = neg_one > const_zero;
27085 #if PY_MAJOR_VERSION < 3
27086  if (likely(PyInt_Check(x))) {
27087  if (sizeof(int64_t) < sizeof(long)) {
27088  __PYX_VERIFY_RETURN_INT(int64_t, long, PyInt_AS_LONG(x))
27089  } else {
27090  long val = PyInt_AS_LONG(x);
27091  if (is_unsigned && unlikely(val < 0)) {
27092  goto raise_neg_overflow;
27093  }
27094  return (int64_t) val;
27095  }
27096  } else
27097 #endif
27098  if (likely(PyLong_Check(x))) {
27099  if (is_unsigned) {
27100 #if CYTHON_USE_PYLONG_INTERNALS
27101  const digit* digits = ((PyLongObject*)x)->ob_digit;
27102  switch (Py_SIZE(x)) {
27103  case 0: return (int64_t) 0;
27104  case 1: __PYX_VERIFY_RETURN_INT(int64_t, digit, digits[0])
27105  case 2:
27106  if (8 * sizeof(int64_t) > 1 * PyLong_SHIFT) {
27107  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27108  __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27109  } else if (8 * sizeof(int64_t) >= 2 * PyLong_SHIFT) {
27110  return (int64_t) (((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]));
27111  }
27112  }
27113  break;
27114  case 3:
27115  if (8 * sizeof(int64_t) > 2 * PyLong_SHIFT) {
27116  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27117  __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27118  } else if (8 * sizeof(int64_t) >= 3 * PyLong_SHIFT) {
27119  return (int64_t) (((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]));
27120  }
27121  }
27122  break;
27123  case 4:
27124  if (8 * sizeof(int64_t) > 3 * PyLong_SHIFT) {
27125  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27126  __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27127  } else if (8 * sizeof(int64_t) >= 4 * PyLong_SHIFT) {
27128  return (int64_t) (((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]));
27129  }
27130  }
27131  break;
27132  }
27133 #endif
27134 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
27135  if (unlikely(Py_SIZE(x) < 0)) {
27136  goto raise_neg_overflow;
27137  }
27138 #else
27139  {
27140  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
27141  if (unlikely(result < 0))
27142  return (int64_t) -1;
27143  if (unlikely(result == 1))
27144  goto raise_neg_overflow;
27145  }
27146 #endif
27147  if (sizeof(int64_t) <= sizeof(unsigned long)) {
27148  __PYX_VERIFY_RETURN_INT_EXC(int64_t, unsigned long, PyLong_AsUnsignedLong(x))
27149 #ifdef HAVE_LONG_LONG
27150  } else if (sizeof(int64_t) <= sizeof(unsigned PY_LONG_LONG)) {
27151  __PYX_VERIFY_RETURN_INT_EXC(int64_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
27152 #endif
27153  }
27154  } else {
27155 #if CYTHON_USE_PYLONG_INTERNALS
27156  const digit* digits = ((PyLongObject*)x)->ob_digit;
27157  switch (Py_SIZE(x)) {
27158  case 0: return (int64_t) 0;
27159  case -1: __PYX_VERIFY_RETURN_INT(int64_t, sdigit, (sdigit) (-(sdigit)digits[0]))
27160  case 1: __PYX_VERIFY_RETURN_INT(int64_t, digit, +digits[0])
27161  case -2:
27162  if (8 * sizeof(int64_t) - 1 > 1 * PyLong_SHIFT) {
27163  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27164  __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27165  } else if (8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT) {
27166  return (int64_t) (((int64_t)-1)*(((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])));
27167  }
27168  }
27169  break;
27170  case 2:
27171  if (8 * sizeof(int64_t) > 1 * PyLong_SHIFT) {
27172  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27173  __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27174  } else if (8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT) {
27175  return (int64_t) ((((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])));
27176  }
27177  }
27178  break;
27179  case -3:
27180  if (8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT) {
27181  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27182  __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27183  } else if (8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT) {
27184  return (int64_t) (((int64_t)-1)*(((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])));
27185  }
27186  }
27187  break;
27188  case 3:
27189  if (8 * sizeof(int64_t) > 2 * PyLong_SHIFT) {
27190  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27191  __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27192  } else if (8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT) {
27193  return (int64_t) ((((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])));
27194  }
27195  }
27196  break;
27197  case -4:
27198  if (8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT) {
27199  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27200  __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27201  } else if (8 * sizeof(int64_t) - 1 > 4 * PyLong_SHIFT) {
27202  return (int64_t) (((int64_t)-1)*(((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])));
27203  }
27204  }
27205  break;
27206  case 4:
27207  if (8 * sizeof(int64_t) > 3 * PyLong_SHIFT) {
27208  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27209  __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27210  } else if (8 * sizeof(int64_t) - 1 > 4 * PyLong_SHIFT) {
27211  return (int64_t) ((((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])));
27212  }
27213  }
27214  break;
27215  }
27216 #endif
27217  if (sizeof(int64_t) <= sizeof(long)) {
27218  __PYX_VERIFY_RETURN_INT_EXC(int64_t, long, PyLong_AsLong(x))
27219 #ifdef HAVE_LONG_LONG
27220  } else if (sizeof(int64_t) <= sizeof(PY_LONG_LONG)) {
27221  __PYX_VERIFY_RETURN_INT_EXC(int64_t, PY_LONG_LONG, PyLong_AsLongLong(x))
27222 #endif
27223  }
27224  }
27225  {
27226 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
27227  PyErr_SetString(PyExc_RuntimeError,
27228  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
27229 #else
27230  int64_t val;
27231  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
27232  #if PY_MAJOR_VERSION < 3
27233  if (likely(v) && !PyLong_Check(v)) {
27234  PyObject *tmp = v;
27235  v = PyNumber_Long(tmp);
27236  Py_DECREF(tmp);
27237  }
27238  #endif
27239  if (likely(v)) {
27240  int one = 1; int is_little = (int)*(unsigned char *)&one;
27241  unsigned char *bytes = (unsigned char *)&val;
27242  int ret = _PyLong_AsByteArray((PyLongObject *)v,
27243  bytes, sizeof(val),
27244  is_little, !is_unsigned);
27245  Py_DECREF(v);
27246  if (likely(!ret))
27247  return val;
27248  }
27249 #endif
27250  return (int64_t) -1;
27251  }
27252  } else {
27253  int64_t val;
27254  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
27255  if (!tmp) return (int64_t) -1;
27256  val = __Pyx_PyInt_As_int64_t(tmp);
27257  Py_DECREF(tmp);
27258  return val;
27259  }
27260 raise_overflow:
27261  PyErr_SetString(PyExc_OverflowError,
27262  "value too large to convert to int64_t");
27263  return (int64_t) -1;
27264 raise_neg_overflow:
27265  PyErr_SetString(PyExc_OverflowError,
27266  "can't convert negative value to int64_t");
27267  return (int64_t) -1;
27268 }
27269 
27270 /* CIntToPy */
27271  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
27272 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27273 #pragma GCC diagnostic push
27274 #pragma GCC diagnostic ignored "-Wconversion"
27275 #endif
27276  const long neg_one = (long) -1, const_zero = (long) 0;
27277 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27278 #pragma GCC diagnostic pop
27279 #endif
27280  const int is_unsigned = neg_one > const_zero;
27281  if (is_unsigned) {
27282  if (sizeof(long) < sizeof(long)) {
27283  return PyInt_FromLong((long) value);
27284  } else if (sizeof(long) <= sizeof(unsigned long)) {
27285  return PyLong_FromUnsignedLong((unsigned long) value);
27286 #ifdef HAVE_LONG_LONG
27287  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
27288  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
27289 #endif
27290  }
27291  } else {
27292  if (sizeof(long) <= sizeof(long)) {
27293  return PyInt_FromLong((long) value);
27294 #ifdef HAVE_LONG_LONG
27295  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
27296  return PyLong_FromLongLong((PY_LONG_LONG) value);
27297 #endif
27298  }
27299  }
27300  {
27301  int one = 1; int little = (int)*(unsigned char *)&one;
27302  unsigned char *bytes = (unsigned char *)&value;
27303  return _PyLong_FromByteArray(bytes, sizeof(long),
27304  little, !is_unsigned);
27305  }
27306 }
27307 
27308 /* CIntToPy */
27309  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
27310 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27311 #pragma GCC diagnostic push
27312 #pragma GCC diagnostic ignored "-Wconversion"
27313 #endif
27314  const int neg_one = (int) -1, const_zero = (int) 0;
27315 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27316 #pragma GCC diagnostic pop
27317 #endif
27318  const int is_unsigned = neg_one > const_zero;
27319  if (is_unsigned) {
27320  if (sizeof(int) < sizeof(long)) {
27321  return PyInt_FromLong((long) value);
27322  } else if (sizeof(int) <= sizeof(unsigned long)) {
27323  return PyLong_FromUnsignedLong((unsigned long) value);
27324 #ifdef HAVE_LONG_LONG
27325  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
27326  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
27327 #endif
27328  }
27329  } else {
27330  if (sizeof(int) <= sizeof(long)) {
27331  return PyInt_FromLong((long) value);
27332 #ifdef HAVE_LONG_LONG
27333  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
27334  return PyLong_FromLongLong((PY_LONG_LONG) value);
27335 #endif
27336  }
27337  }
27338  {
27339  int one = 1; int little = (int)*(unsigned char *)&one;
27340  unsigned char *bytes = (unsigned char *)&value;
27341  return _PyLong_FromByteArray(bytes, sizeof(int),
27342  little, !is_unsigned);
27343  }
27344 }
27345 
27346 /* CIntFromPy */
27347  static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
27348 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27349 #pragma GCC diagnostic push
27350 #pragma GCC diagnostic ignored "-Wconversion"
27351 #endif
27352  const long neg_one = (long) -1, const_zero = (long) 0;
27353 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27354 #pragma GCC diagnostic pop
27355 #endif
27356  const int is_unsigned = neg_one > const_zero;
27357 #if PY_MAJOR_VERSION < 3
27358  if (likely(PyInt_Check(x))) {
27359  if (sizeof(long) < sizeof(long)) {
27360  __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
27361  } else {
27362  long val = PyInt_AS_LONG(x);
27363  if (is_unsigned && unlikely(val < 0)) {
27364  goto raise_neg_overflow;
27365  }
27366  return (long) val;
27367  }
27368  } else
27369 #endif
27370  if (likely(PyLong_Check(x))) {
27371  if (is_unsigned) {
27372 #if CYTHON_USE_PYLONG_INTERNALS
27373  const digit* digits = ((PyLongObject*)x)->ob_digit;
27374  switch (Py_SIZE(x)) {
27375  case 0: return (long) 0;
27376  case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
27377  case 2:
27378  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
27379  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27380  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27381  } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
27382  return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
27383  }
27384  }
27385  break;
27386  case 3:
27387  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
27388  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27389  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27390  } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
27391  return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
27392  }
27393  }
27394  break;
27395  case 4:
27396  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
27397  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27398  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27399  } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
27400  return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
27401  }
27402  }
27403  break;
27404  }
27405 #endif
27406 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
27407  if (unlikely(Py_SIZE(x) < 0)) {
27408  goto raise_neg_overflow;
27409  }
27410 #else
27411  {
27412  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
27413  if (unlikely(result < 0))
27414  return (long) -1;
27415  if (unlikely(result == 1))
27416  goto raise_neg_overflow;
27417  }
27418 #endif
27419  if (sizeof(long) <= sizeof(unsigned long)) {
27420  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
27421 #ifdef HAVE_LONG_LONG
27422  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
27423  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
27424 #endif
27425  }
27426  } else {
27427 #if CYTHON_USE_PYLONG_INTERNALS
27428  const digit* digits = ((PyLongObject*)x)->ob_digit;
27429  switch (Py_SIZE(x)) {
27430  case 0: return (long) 0;
27431  case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
27432  case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
27433  case -2:
27434  if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
27435  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27436  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27437  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
27438  return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
27439  }
27440  }
27441  break;
27442  case 2:
27443  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
27444  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27445  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27446  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
27447  return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
27448  }
27449  }
27450  break;
27451  case -3:
27452  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
27453  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27454  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27455  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
27456  return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
27457  }
27458  }
27459  break;
27460  case 3:
27461  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
27462  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27463  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27464  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
27465  return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
27466  }
27467  }
27468  break;
27469  case -4:
27470  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
27471  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27472  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27473  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
27474  return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
27475  }
27476  }
27477  break;
27478  case 4:
27479  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
27480  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27481  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27482  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
27483  return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
27484  }
27485  }
27486  break;
27487  }
27488 #endif
27489  if (sizeof(long) <= sizeof(long)) {
27490  __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
27491 #ifdef HAVE_LONG_LONG
27492  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
27493  __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
27494 #endif
27495  }
27496  }
27497  {
27498 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
27499  PyErr_SetString(PyExc_RuntimeError,
27500  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
27501 #else
27502  long val;
27503  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
27504  #if PY_MAJOR_VERSION < 3
27505  if (likely(v) && !PyLong_Check(v)) {
27506  PyObject *tmp = v;
27507  v = PyNumber_Long(tmp);
27508  Py_DECREF(tmp);
27509  }
27510  #endif
27511  if (likely(v)) {
27512  int one = 1; int is_little = (int)*(unsigned char *)&one;
27513  unsigned char *bytes = (unsigned char *)&val;
27514  int ret = _PyLong_AsByteArray((PyLongObject *)v,
27515  bytes, sizeof(val),
27516  is_little, !is_unsigned);
27517  Py_DECREF(v);
27518  if (likely(!ret))
27519  return val;
27520  }
27521 #endif
27522  return (long) -1;
27523  }
27524  } else {
27525  long val;
27526  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
27527  if (!tmp) return (long) -1;
27528  val = __Pyx_PyInt_As_long(tmp);
27529  Py_DECREF(tmp);
27530  return val;
27531  }
27532 raise_overflow:
27533  PyErr_SetString(PyExc_OverflowError,
27534  "value too large to convert to long");
27535  return (long) -1;
27536 raise_neg_overflow:
27537  PyErr_SetString(PyExc_OverflowError,
27538  "can't convert negative value to long");
27539  return (long) -1;
27540 }
27541 
27542 /* CIntFromPy */
27543  static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
27544 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27545 #pragma GCC diagnostic push
27546 #pragma GCC diagnostic ignored "-Wconversion"
27547 #endif
27548  const char neg_one = (char) -1, const_zero = (char) 0;
27549 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27550 #pragma GCC diagnostic pop
27551 #endif
27552  const int is_unsigned = neg_one > const_zero;
27553 #if PY_MAJOR_VERSION < 3
27554  if (likely(PyInt_Check(x))) {
27555  if (sizeof(char) < sizeof(long)) {
27556  __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x))
27557  } else {
27558  long val = PyInt_AS_LONG(x);
27559  if (is_unsigned && unlikely(val < 0)) {
27560  goto raise_neg_overflow;
27561  }
27562  return (char) val;
27563  }
27564  } else
27565 #endif
27566  if (likely(PyLong_Check(x))) {
27567  if (is_unsigned) {
27568 #if CYTHON_USE_PYLONG_INTERNALS
27569  const digit* digits = ((PyLongObject*)x)->ob_digit;
27570  switch (Py_SIZE(x)) {
27571  case 0: return (char) 0;
27572  case 1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0])
27573  case 2:
27574  if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
27575  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27576  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27577  } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) {
27578  return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
27579  }
27580  }
27581  break;
27582  case 3:
27583  if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
27584  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27585  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27586  } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) {
27587  return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
27588  }
27589  }
27590  break;
27591  case 4:
27592  if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
27593  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27594  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27595  } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) {
27596  return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
27597  }
27598  }
27599  break;
27600  }
27601 #endif
27602 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
27603  if (unlikely(Py_SIZE(x) < 0)) {
27604  goto raise_neg_overflow;
27605  }
27606 #else
27607  {
27608  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
27609  if (unlikely(result < 0))
27610  return (char) -1;
27611  if (unlikely(result == 1))
27612  goto raise_neg_overflow;
27613  }
27614 #endif
27615  if (sizeof(char) <= sizeof(unsigned long)) {
27616  __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
27617 #ifdef HAVE_LONG_LONG
27618  } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
27619  __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
27620 #endif
27621  }
27622  } else {
27623 #if CYTHON_USE_PYLONG_INTERNALS
27624  const digit* digits = ((PyLongObject*)x)->ob_digit;
27625  switch (Py_SIZE(x)) {
27626  case 0: return (char) 0;
27627  case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0]))
27628  case 1: __PYX_VERIFY_RETURN_INT(char, digit, +digits[0])
27629  case -2:
27630  if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) {
27631  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27632  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27633  } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
27634  return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
27635  }
27636  }
27637  break;
27638  case 2:
27639  if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
27640  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27641  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27642  } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
27643  return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
27644  }
27645  }
27646  break;
27647  case -3:
27648  if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
27649  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27650  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27651  } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
27652  return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
27653  }
27654  }
27655  break;
27656  case 3:
27657  if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
27658  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27659  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27660  } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
27661  return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
27662  }
27663  }
27664  break;
27665  case -4:
27666  if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
27667  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27668  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27669  } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
27670  return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
27671  }
27672  }
27673  break;
27674  case 4:
27675  if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
27676  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27677  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27678  } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
27679  return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
27680  }
27681  }
27682  break;
27683  }
27684 #endif
27685  if (sizeof(char) <= sizeof(long)) {
27686  __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
27687 #ifdef HAVE_LONG_LONG
27688  } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
27689  __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
27690 #endif
27691  }
27692  }
27693  {
27694 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
27695  PyErr_SetString(PyExc_RuntimeError,
27696  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
27697 #else
27698  char val;
27699  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
27700  #if PY_MAJOR_VERSION < 3
27701  if (likely(v) && !PyLong_Check(v)) {
27702  PyObject *tmp = v;
27703  v = PyNumber_Long(tmp);
27704  Py_DECREF(tmp);
27705  }
27706  #endif
27707  if (likely(v)) {
27708  int one = 1; int is_little = (int)*(unsigned char *)&one;
27709  unsigned char *bytes = (unsigned char *)&val;
27710  int ret = _PyLong_AsByteArray((PyLongObject *)v,
27711  bytes, sizeof(val),
27712  is_little, !is_unsigned);
27713  Py_DECREF(v);
27714  if (likely(!ret))
27715  return val;
27716  }
27717 #endif
27718  return (char) -1;
27719  }
27720  } else {
27721  char val;
27722  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
27723  if (!tmp) return (char) -1;
27724  val = __Pyx_PyInt_As_char(tmp);
27725  Py_DECREF(tmp);
27726  return val;
27727  }
27728 raise_overflow:
27729  PyErr_SetString(PyExc_OverflowError,
27730  "value too large to convert to char");
27731  return (char) -1;
27732 raise_neg_overflow:
27733  PyErr_SetString(PyExc_OverflowError,
27734  "can't convert negative value to char");
27735  return (char) -1;
27736 }
27737 
27738 /* CheckBinaryVersion */
27739  static int __Pyx_check_binary_version(void) {
27740  char ctversion[5];
27741  int same=1, i, found_dot;
27742  const char* rt_from_call = Py_GetVersion();
27743  PyOS_snprintf(ctversion, 5, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
27744  found_dot = 0;
27745  for (i = 0; i < 4; i++) {
27746  if (!ctversion[i]) {
27747  same = (rt_from_call[i] < '0' || rt_from_call[i] > '9');
27748  break;
27749  }
27750  if (rt_from_call[i] != ctversion[i]) {
27751  same = 0;
27752  break;
27753  }
27754  }
27755  if (!same) {
27756  char rtversion[5] = {'\0'};
27757  char message[200];
27758  for (i=0; i<4; ++i) {
27759  if (rt_from_call[i] == '.') {
27760  if (found_dot) break;
27761  found_dot = 1;
27762  } else if (rt_from_call[i] < '0' || rt_from_call[i] > '9') {
27763  break;
27764  }
27765  rtversion[i] = rt_from_call[i];
27766  }
27767  PyOS_snprintf(message, sizeof(message),
27768  "compiletime version %s of module '%.100s' "
27769  "does not match runtime version %s",
27770  ctversion, __Pyx_MODULE_NAME, rtversion);
27771  return PyErr_WarnEx(NULL, message, 1);
27772  }
27773  return 0;
27774 }
27775 
27776 /* FunctionExport */
27777  static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) {
27778  PyObject *d = 0;
27779  PyObject *cobj = 0;
27780  union {
27781  void (*fp)(void);
27782  void *p;
27783  } tmp;
27784  d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__");
27785  if (!d) {
27786  PyErr_Clear();
27787  d = PyDict_New();
27788  if (!d)
27789  goto bad;
27790  Py_INCREF(d);
27791  if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0)
27792  goto bad;
27793  }
27794  tmp.fp = f;
27795 #if PY_VERSION_HEX >= 0x02070000
27796  cobj = PyCapsule_New(tmp.p, sig, 0);
27797 #else
27798  cobj = PyCObject_FromVoidPtrAndDesc(tmp.p, (void *)sig, 0);
27799 #endif
27800  if (!cobj)
27801  goto bad;
27802  if (PyDict_SetItemString(d, name, cobj) < 0)
27803  goto bad;
27804  Py_DECREF(cobj);
27805  Py_DECREF(d);
27806  return 0;
27807 bad:
27808  Py_XDECREF(cobj);
27809  Py_XDECREF(d);
27810  return -1;
27811 }
27812 
27813 /* FunctionImport */
27814  #ifndef __PYX_HAVE_RT_ImportFunction_0_29_36
27815 #define __PYX_HAVE_RT_ImportFunction_0_29_36
27816 static int __Pyx_ImportFunction_0_29_36(PyObject *module, const char *funcname, void (**f)(void), const char *sig) {
27817  PyObject *d = 0;
27818  PyObject *cobj = 0;
27819  union {
27820  void (*fp)(void);
27821  void *p;
27822  } tmp;
27823  d = PyObject_GetAttrString(module, (char *)"__pyx_capi__");
27824  if (!d)
27825  goto bad;
27826  cobj = PyDict_GetItemString(d, funcname);
27827  if (!cobj) {
27828  PyErr_Format(PyExc_ImportError,
27829  "%.200s does not export expected C function %.200s",
27830  PyModule_GetName(module), funcname);
27831  goto bad;
27832  }
27833 #if PY_VERSION_HEX >= 0x02070000
27834  if (!PyCapsule_IsValid(cobj, sig)) {
27835  PyErr_Format(PyExc_TypeError,
27836  "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
27837  PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj));
27838  goto bad;
27839  }
27840  tmp.p = PyCapsule_GetPointer(cobj, sig);
27841 #else
27842  {const char *desc, *s1, *s2;
27843  desc = (const char *)PyCObject_GetDesc(cobj);
27844  if (!desc)
27845  goto bad;
27846  s1 = desc; s2 = sig;
27847  while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; }
27848  if (*s1 != *s2) {
27849  PyErr_Format(PyExc_TypeError,
27850  "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
27851  PyModule_GetName(module), funcname, sig, desc);
27852  goto bad;
27853  }
27854  tmp.p = PyCObject_AsVoidPtr(cobj);}
27855 #endif
27856  *f = tmp.fp;
27857  if (!(*f))
27858  goto bad;
27859  Py_DECREF(d);
27860  return 0;
27861 bad:
27862  Py_XDECREF(d);
27863  return -1;
27864 }
27865 #endif
27866 
27867 /* InitStrings */
27868  static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
27869  while (t->p) {
27870  #if PY_MAJOR_VERSION < 3
27871  if (t->is_unicode) {
27872  *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
27873  } else if (t->intern) {
27874  *t->p = PyString_InternFromString(t->s);
27875  } else {
27876  *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
27877  }
27878  #else
27879  if (t->is_unicode | t->is_str) {
27880  if (t->intern) {
27881  *t->p = PyUnicode_InternFromString(t->s);
27882  } else if (t->encoding) {
27883  *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
27884  } else {
27885  *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
27886  }
27887  } else {
27888  *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
27889  }
27890  #endif
27891  if (!*t->p)
27892  return -1;
27893  if (PyObject_Hash(*t->p) == -1)
27894  return -1;
27895  ++t;
27896  }
27897  return 0;
27898 }
27899 
27900 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
27901  return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
27902 }
27903 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
27904  Py_ssize_t ignore;
27905  return __Pyx_PyObject_AsStringAndSize(o, &ignore);
27906 }
27907 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
27908 #if !CYTHON_PEP393_ENABLED
27909 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
27910  char* defenc_c;
27911  PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
27912  if (!defenc) return NULL;
27913  defenc_c = PyBytes_AS_STRING(defenc);
27914 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
27915  {
27916  char* end = defenc_c + PyBytes_GET_SIZE(defenc);
27917  char* c;
27918  for (c = defenc_c; c < end; c++) {
27919  if ((unsigned char) (*c) >= 128) {
27920  PyUnicode_AsASCIIString(o);
27921  return NULL;
27922  }
27923  }
27924  }
27925 #endif
27926  *length = PyBytes_GET_SIZE(defenc);
27927  return defenc_c;
27928 }
27929 #else
27930 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
27931  if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
27932 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
27933  if (likely(PyUnicode_IS_ASCII(o))) {
27934  *length = PyUnicode_GET_LENGTH(o);
27935  return PyUnicode_AsUTF8(o);
27936  } else {
27937  PyUnicode_AsASCIIString(o);
27938  return NULL;
27939  }
27940 #else
27941  return PyUnicode_AsUTF8AndSize(o, length);
27942 #endif
27943 }
27944 #endif
27945 #endif
27946 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
27947 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
27948  if (
27949 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
27950  __Pyx_sys_getdefaultencoding_not_ascii &&
27951 #endif
27952  PyUnicode_Check(o)) {
27953  return __Pyx_PyUnicode_AsStringAndSize(o, length);
27954  } else
27955 #endif
27956 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
27957  if (PyByteArray_Check(o)) {
27958  *length = PyByteArray_GET_SIZE(o);
27959  return PyByteArray_AS_STRING(o);
27960  } else
27961 #endif
27962  {
27963  char* result;
27964  int r = PyBytes_AsStringAndSize(o, &result, length);
27965  if (unlikely(r < 0)) {
27966  return NULL;
27967  } else {
27968  return result;
27969  }
27970  }
27971 }
27972 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
27973  int is_true = x == Py_True;
27974  if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
27975  else return PyObject_IsTrue(x);
27976 }
27977 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
27978  int retval;
27979  if (unlikely(!x)) return -1;
27980  retval = __Pyx_PyObject_IsTrue(x);
27981  Py_DECREF(x);
27982  return retval;
27983 }
27984 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
27985 #if PY_MAJOR_VERSION >= 3
27986  if (PyLong_Check(result)) {
27987  if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
27988  "__int__ returned non-int (type %.200s). "
27989  "The ability to return an instance of a strict subclass of int "
27990  "is deprecated, and may be removed in a future version of Python.",
27991  Py_TYPE(result)->tp_name)) {
27992  Py_DECREF(result);
27993  return NULL;
27994  }
27995  return result;
27996  }
27997 #endif
27998  PyErr_Format(PyExc_TypeError,
27999  "__%.4s__ returned non-%.4s (type %.200s)",
28000  type_name, type_name, Py_TYPE(result)->tp_name);
28001  Py_DECREF(result);
28002  return NULL;
28003 }
28004 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
28005 #if CYTHON_USE_TYPE_SLOTS
28006  PyNumberMethods *m;
28007 #endif
28008  const char *name = NULL;
28009  PyObject *res = NULL;
28010 #if PY_MAJOR_VERSION < 3
28011  if (likely(PyInt_Check(x) || PyLong_Check(x)))
28012 #else
28013  if (likely(PyLong_Check(x)))
28014 #endif
28015  return __Pyx_NewRef(x);
28016 #if CYTHON_USE_TYPE_SLOTS
28017  m = Py_TYPE(x)->tp_as_number;
28018  #if PY_MAJOR_VERSION < 3
28019  if (m && m->nb_int) {
28020  name = "int";
28021  res = m->nb_int(x);
28022  }
28023  else if (m && m->nb_long) {
28024  name = "long";
28025  res = m->nb_long(x);
28026  }
28027  #else
28028  if (likely(m && m->nb_int)) {
28029  name = "int";
28030  res = m->nb_int(x);
28031  }
28032  #endif
28033 #else
28034  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
28035  res = PyNumber_Int(x);
28036  }
28037 #endif
28038  if (likely(res)) {
28039 #if PY_MAJOR_VERSION < 3
28040  if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
28041 #else
28042  if (unlikely(!PyLong_CheckExact(res))) {
28043 #endif
28044  return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
28045  }
28046  }
28047  else if (!PyErr_Occurred()) {
28048  PyErr_SetString(PyExc_TypeError,
28049  "an integer is required");
28050  }
28051  return res;
28052 }
28053 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
28054  Py_ssize_t ival;
28055  PyObject *x;
28056 #if PY_MAJOR_VERSION < 3
28057  if (likely(PyInt_CheckExact(b))) {
28058  if (sizeof(Py_ssize_t) >= sizeof(long))
28059  return PyInt_AS_LONG(b);
28060  else
28061  return PyInt_AsSsize_t(b);
28062  }
28063 #endif
28064  if (likely(PyLong_CheckExact(b))) {
28065  #if CYTHON_USE_PYLONG_INTERNALS
28066  const digit* digits = ((PyLongObject*)b)->ob_digit;
28067  const Py_ssize_t size = Py_SIZE(b);
28068  if (likely(__Pyx_sst_abs(size) <= 1)) {
28069  ival = likely(size) ? digits[0] : 0;
28070  if (size == -1) ival = -ival;
28071  return ival;
28072  } else {
28073  switch (size) {
28074  case 2:
28075  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
28076  return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28077  }
28078  break;
28079  case -2:
28080  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
28081  return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28082  }
28083  break;
28084  case 3:
28085  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
28086  return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28087  }
28088  break;
28089  case -3:
28090  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
28091  return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28092  }
28093  break;
28094  case 4:
28095  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
28096  return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28097  }
28098  break;
28099  case -4:
28100  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
28101  return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28102  }
28103  break;
28104  }
28105  }
28106  #endif
28107  return PyLong_AsSsize_t(b);
28108  }
28109  x = PyNumber_Index(b);
28110  if (!x) return -1;
28111  ival = PyInt_AsSsize_t(x);
28112  Py_DECREF(x);
28113  return ival;
28114 }
28115 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
28116  if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
28117  return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
28118 #if PY_MAJOR_VERSION < 3
28119  } else if (likely(PyInt_CheckExact(o))) {
28120  return PyInt_AS_LONG(o);
28121 #endif
28122  } else {
28123  Py_ssize_t ival;
28124  PyObject *x;
28125  x = PyNumber_Index(o);
28126  if (!x) return -1;
28127  ival = PyInt_AsLong(x);
28128  Py_DECREF(x);
28129  return ival;
28130  }
28131 }
28132 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
28133  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
28134 }
28135 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
28136  return PyInt_FromSize_t(ival);
28137 }
28138 
28139 
28140 #endif /* Py_PYTHON_H */
Defines the function .
Definition: functions.h:38
Base class for linear operators. This class serves as interface for all derived classes.
static FlagType c_trace_estimator(cLinearOperator< DataType > *A, DataType *parameters, const IndexType num_inquiries, const Function *matrix_function, const FlagType gram, const DataType exponent, const FlagType orthogonalize, const int64_t seed, const IndexType lanczos_degree, const DataType lanczos_tol, const IndexType min_num_samples, const IndexType max_num_samples, const DataType error_atol, const DataType error_rtol, const DataType confidence_level, const DataType outlier_significance_level, const IndexType num_threads, DataType *trace, DataType *error, DataType **samples, IndexType *processed_samples_indices, IndexType *num_samples_used, IndexType *num_outliers, FlagType *converged, float &alg_wall_time)
Stochastic Lanczos quadrature method to estimate trace of a function of a linear operator....
void lapack_sbdsdc(char *uplo, char *compq, int *n, float *d, float *e, float *u, int *ldu, float *vt, int *ldvt, float *q, int *iq, float *work, int *iwork, int *info)
void lapack_dstev(char *jobz, int *n, double *d, double *e, double *z, int *ldz, double *work, int *info)
void lapack_dbdsdc(char *uplo, char *compq, int *n, double *d, double *e, double *u, int *ldu, double *vt, int *ldvt, double *q, int *iq, double *work, int *iwork, int *info)
#define __PYX_EXTERN_C
__PYX_EXTERN_C void lapack_sstev(char *, int *, float *, float *, float *, int *, float *, int *)
PyMODINIT_FUNC initpy_c_trace_estimator(void)
int LongIndexType
Definition: types.h:60